Next: , Previous: CharacterArray-multibyte encodings, Up: CharacterArray


1.29.7 CharacterArray: string processing

% anArray
Answer the receiver with every %n (1<=n<=9) replaced by the n-th element of anArray. The replaced elements are `displayed' (i.e. their displayString is used). In addition, the special pattern %<trueString|falseString>n is replaced with one of the two strings depending on the n-th element of anArray being true or false.


bindWith: s1
Answer the receiver with every %1 replaced by the displayString of s1


bindWith: s1 with: s2
Answer the receiver with every %1 or %2 replaced by s1 or s2, respectively. s1 and s2 are `displayed' (i.e. their displayString is used) upon replacement.


bindWith: s1 with: s2 with: s3
Answer the receiver with every %1, %2 or %3 replaced by s1, s2 or s3, respectively. s1, s2 and s3 are `displayed' (i.e. their displayString is used) upon replacement.


bindWith: s1 with: s2 with: s3 with: s4
Answer the receiver with every %1, %2, %3 or %4 replaced by s1, s2, s3 or s4, respectively. s1, s2, s3 and s4 are `displayed' (i.e. their displayString is used) upon replacement.


bindWithArguments: anArray
Answer the receiver with every %n (1<=n<=9) replaced by the n-th element of anArray. The replaced elements are `displayed' (i.e. their displayString is used). In addition, the special pattern %<trueString|falseString>n is replaced with one of the two strings depending on the n-th element of anArray being true or false.


contractTo: smallSize
Either return myself, or a copy shortened to smallSize characters by inserting an ellipsis (three dots: ...)


lines
Answer an Array of Strings each representing one line in the receiver.


linesDo: aBlock
Evaluate aBlock once for every newline delimited line in the receiver, passing the line to the block.


subStrings
Answer an OrderedCollection of substrings of the receiver. A new substring start at the start of the receiver, or after every sequence of white space characters


subStrings: aCharacter
Answer an OrderedCollection of substrings of the receiver. A new substring start at the start of the receiver, or after every sequence of characters matching aCharacter


substrings
Answer an OrderedCollection of substrings of the receiver. A new substring start at the start of the receiver, or after every sequence of white space characters. This message is preserved for backwards compatibility; the ANSI standard mandates `subStrings', with an uppercase s.


substrings: aCharacter
Answer an OrderedCollection of substrings of the receiver. A new substring start at the start of the receiver, or after every sequence of characters matching aCharacter. This message is preserved for backwards compatibility; the ANSI standard mandates `subStrings:', with an uppercase s.