CharacterArray.st
changeset 22924 f506768961d7
parent 22911 7a780ffd6698
child 22929 fda0476a0fbd
equal deleted inserted replaced
22923:cb7ed00c7904 22924:f506768961d7
   608 
   608 
   609     "
   609     "
   610      self unicodeNormalizationMap
   610      self unicodeNormalizationMap
   611     "
   611     "
   612 ! !
   612 ! !
       
   613 
   613 
   614 
   614 !CharacterArray class methodsFor:'pattern matching'!
   615 !CharacterArray class methodsFor:'pattern matching'!
   615 
   616 
   616 matchEscapeCharacter
   617 matchEscapeCharacter
   617     "return the character used to escape a matchCharacter
   618     "return the character used to escape a matchCharacter
  1014     characterSize <= 8 ifTrue:[^ String].
  1015     characterSize <= 8 ifTrue:[^ String].
  1015     characterSize <= 16 ifTrue:[^ Unicode16String].
  1016     characterSize <= 16 ifTrue:[^ Unicode16String].
  1016     ^ Unicode32String
  1017     ^ Unicode32String
  1017 ! !
  1018 ! !
  1018 
  1019 
       
  1020 
  1019 !CharacterArray class methodsFor:'utilities'!
  1021 !CharacterArray class methodsFor:'utilities'!
  1020 
  1022 
  1021 withoutAmpersandEscapes:label
  1023 withoutAmpersandEscapes:label
  1022     "remove single ampersands;
  1024     "remove single ampersands;
  1023      replace double ampersands by single ones.
  1025      replace double ampersands by single ones.
  1743                                          with:str9)
  1745                                          with:str9)
  1744 
  1746 
  1745     "Created: / 14-02-2012 / 17:42:31 / cg"
  1747     "Created: / 14-02-2012 / 17:42:31 / cg"
  1746 !
  1748 !
  1747 
  1749 
  1748 bindWithArguments:anArrayOfStrings
  1750 bindWithArguments:argumentsCollection
  1749     "return a copy of the receiver, where a '%i' escape
  1751     "return a copy of the receiver, where a '%i' escape
  1750      is replaced by the corresponding string from the argument array.
  1752      is replaced by the corresponding string from the argument array.
  1751      'i' may be between 1 and 9 (i.e. a maximum of 9 placeholders is allowed).
  1753      'i' may be between 1 and 9 (i.e. a maximum of 9 placeholders is allowed)
       
  1754      or %(key); the argumentsCollection must then be a dictionary.
  1752      To get an integer-indexed placeHolder followed by another digit,
  1755      To get an integer-indexed placeHolder followed by another digit,
  1753      or an index > 9, you must use %(digit).
  1756      or an index > 9, you must use %(digit).
  1754      This has been added for VisualAge compatibility."
  1757      This has been added for VisualAge compatibility."
  1755 
  1758 
  1756     ^ self expandPlaceholdersWith:anArrayOfStrings
  1759     ^ self expandPlaceholdersWith:argumentsCollection
  1757 
  1760 
  1758     "
  1761     "
  1759      'do you prefer %1 or rather %2 (not talking about %3) ?'
  1762      'do you prefer %1 or rather %2 (not talking about %3) ?'
  1760         bindWithArguments:#('smalltalk' 'c++' 'c')
  1763         bindWithArguments:#('smalltalk' 'c++' 'c')
  1761 
  1764 
  6542     "
  6545     "
  6543 
  6546 
  6544     "Created: 12.5.1996 / 20:09:29 / cg"
  6547     "Created: 12.5.1996 / 20:09:29 / cg"
  6545     "Modified: 17.4.1997 / 12:50:23 / cg"
  6548     "Modified: 17.4.1997 / 12:50:23 / cg"
  6546 ! !
  6549 ! !
       
  6550 
  6547 
  6551 
  6548 !CharacterArray methodsFor:'special string converting'!
  6552 !CharacterArray methodsFor:'special string converting'!
  6549 
  6553 
  6550 asUnixFilenameString
  6554 asUnixFilenameString
  6551     "return a new string consisting of receiver's characters
  6555     "return a new string consisting of receiver's characters
  7604      ('  ' , Character tab asString , ' foo   ') withoutTrailingSeparators inspect
  7608      ('  ' , Character tab asString , ' foo   ') withoutTrailingSeparators inspect
  7605      ('   foo' , Character tab asString) withoutTrailingSeparators inspect
  7609      ('   foo' , Character tab asString) withoutTrailingSeparators inspect
  7606     "
  7610     "
  7607 ! !
  7611 ! !
  7608 
  7612 
       
  7613 
  7609 !CharacterArray methodsFor:'substring searching'!
  7614 !CharacterArray methodsFor:'substring searching'!
  7610 
  7615 
  7611 findRangeOfString:subString
  7616 findRangeOfString:subString
  7612     "find a substring. if found, return the start- and endIndex;
  7617     "find a substring. if found, return the start- and endIndex;
  7613      if not found, return an empty interval."
  7618      if not found, return an empty interval."