Apple WebObjects 3.5 Uživatelský manuál Strana 194

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 218
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 193
Chapter 11 WebScript Programmer’s Quick Reference to Foundation Classes
194
– substringFromIndex:
Returns a string containing the characters of the receiver from the
character at the specified index to the end.
Comparing Strings
– compare:
Returns –1 if the receiver precedes a specified string in lexical
ordering, 0 if it is equal, and 1 if it follows. For example, the following
statements result in an NSString that has the contents “‘hello’
precedes ‘Hello’ lexicographically.”:
if ([@"hello" compare:@"Hello"] == -1) {
result = [NSString stringWithFormat:
@"'%@' precedes '%@' lexicographically.",
@"hello", @"Hello"];
}
– caseInsensitiveCompare:
Same as compare:, but case distinctions among characters are ignored.
– isEqual:
Returns YES if a specified object is equivalent to the receiver; NO
otherwise. An object is equivalent to a string if the object is an
NSString or an NSMutableString and
compare: returns 0. For example,
the following statements:
if ([string isEqual:newString]) {
result = @"Found a match";
}
assign the contents “Found a match” to result if string and newString are
lexicographically equal.
Converting String Contents
– doubleValue
Returns the floating-point value of the receiver’s text as a double,
skipping white space at the beginning of the string.
– floatValue
Returns the floating-point value of the receiver’s text as a float,
skipping white space at the beginning of the string.
– intValue
Returns the integer value of the string’s text, assuming a decimal
representation and skipping white space at the beginning of the string.
Zobrazit stránku 193
1 2 ... 189 190 191 192 193 194 195 196 197 198 199 ... 217 218

Komentáře k této Příručce

Žádné komentáře