Before we can do anything String-specific with that retrieved value, we have to cast it to a String, even when the retrieved element was added in the same code block!
在对检索到的值进行任何特定于String的操作之前,必须将它强制转换为String,即使是将检索到的元素添加到同一代码块中,也是如此!
To specify an int variable for an iterator and a String variable for element name, use the code in Listing 17.
要为迭代器指定一个int变量并为元素名称指定一个String变量,请使用清单17中的代码。
The call to filter converts the string that is passed as its second argument to a piece of code, which it then applies to each element of the list that is passed as its first argument.
调用filter将作为第二个参数传递的字符串转换成一段代码,然后将该代码应用到作为第一个参数传递的列表的每个元素。
Listing 22 is a modified version of code originally provided by Sam Ruby that takes the JSON serialization of an Atom text construct or content element and converts it back into a string.
清单22对最初由SamRuby提供的代码进行了修改,包含Atom文本结构或内容元素的JSON序列化,并将其转换为一个字符串。
If the name is title, the code puts the actual contents of the element into the String variable title.
如果这个元素的名字是title,这段代码将把该元素的实际内容放到字符串变量title中。
If the name is title, the code puts the actual contents of the element into the String variable title.
如果这个元素的名字是title,这段代码将把该元素的实际内容放到字符串变量title中。
应用推荐