CharacterArray.st
changeset 16757 da377b8c79f5
parent 16738 bd9416219f7c
child 16759 347181805b43
equal deleted inserted replaced
16756:33c2eb0a82f6 16757:da377b8c79f5
   323    invalid:
   323    invalid:
   324      CharacterArray fromUTF8Bytes:#[ 16rC0 16r80 ]
   324      CharacterArray fromUTF8Bytes:#[ 16rC0 16r80 ]
   325      CharacterArray fromUTF8Bytes:#[ 16rE0 16r80 16r80 ]
   325      CharacterArray fromUTF8Bytes:#[ 16rE0 16r80 16r80 ]
   326     "
   326     "
   327 ! !
   327 ! !
   328 
       
   329 
   328 
   330 !CharacterArray class methodsFor:'pattern matching'!
   329 !CharacterArray class methodsFor:'pattern matching'!
   331 
   330 
   332 matchEscapeCharacter
   331 matchEscapeCharacter
   333     "return the character used to escape a matchCharacter
   332     "return the character used to escape a matchCharacter
   722      Abstract subclasses must redefine again."
   721      Abstract subclasses must redefine again."
   723 
   722 
   724     ^ self == CharacterArray
   723     ^ self == CharacterArray
   725 ! !
   724 ! !
   726 
   725 
   727 
       
   728 !CharacterArray methodsFor:'Compatibility-ANSI'!
   726 !CharacterArray methodsFor:'Compatibility-ANSI'!
   729 
   727 
   730 addLineDelimiters
   728 addLineDelimiters
   731     "Ansi compatibility - same as withCRs"
   729     "Ansi compatibility - same as withCRs"
   732 
   730 
  3303     ^ UnixFilename named:self
  3301     ^ UnixFilename named:self
  3304 
  3302 
  3305     "Created: / 20-09-2010 / 21:42:55 / cg"
  3303     "Created: / 20-09-2010 / 21:42:55 / cg"
  3306 !
  3304 !
  3307 
  3305 
       
  3306 asUnixFilenameString
       
  3307     "return a new string consisting of receiver's characters
       
  3308      with all \-characters replaced by /-characters.
       
  3309      If there are no backslashes, return the original"
       
  3310 
       
  3311     (self includes:$\) ifFalse:[^ self].
       
  3312     ^ self copyReplaceAll:$\ with:$/
       
  3313 
       
  3314     "
       
  3315      'hello\world' asUnixFilenameString
       
  3316     "
       
  3317 
       
  3318     "Modified: / 18.7.1998 / 22:53:02 / cg"
       
  3319 !
       
  3320 
  3308 asUppercase
  3321 asUppercase
  3309     "return a copy of myself in uppercase letters"
  3322     "return a copy of myself in uppercase letters"
  3310 
  3323 
  3311     |newStr c bitsPerCharacter
  3324     |newStr c bitsPerCharacter
  3312      mySize "{ Class: SmallInteger }" |
  3325      mySize "{ Class: SmallInteger }" |
  4801 
  4814 
  4802     ^ aPatternString match:self caseSensitive:ignoreCase not
  4815     ^ aPatternString match:self caseSensitive:ignoreCase not
  4803 
  4816 
  4804     "Created: / 08-03-2012 / 03:11:11 / cg"
  4817     "Created: / 08-03-2012 / 03:11:11 / cg"
  4805 ! !
  4818 ! !
  4806 
       
  4807 
  4819 
  4808 
  4820 
  4809 !CharacterArray methodsFor:'padded copying'!
  4821 !CharacterArray methodsFor:'padded copying'!
  4810 
  4822 
  4811 centerPaddedTo:newSize
  4823 centerPaddedTo:newSize
  5431     "
  5443     "
  5432 
  5444 
  5433     "Created: 12.5.1996 / 20:09:29 / cg"
  5445     "Created: 12.5.1996 / 20:09:29 / cg"
  5434     "Modified: 17.4.1997 / 12:50:23 / cg"
  5446     "Modified: 17.4.1997 / 12:50:23 / cg"
  5435 ! !
  5447 ! !
  5436 
       
  5437 
  5448 
  5438 !CharacterArray methodsFor:'special string converting'!
  5449 !CharacterArray methodsFor:'special string converting'!
  5439 
  5450 
  5440 expandPlaceholders:escapeCharacter with:argArrayOrDictionary
  5451 expandPlaceholders:escapeCharacter with:argArrayOrDictionary
  5441     "this is the generic version of the old %-escaping method, allowing for an arbitrary
  5452     "this is the generic version of the old %-escaping method, allowing for an arbitrary
  5813 
  5824 
  5814     "Created: / 25-01-2012 / 11:08:16 / cg"
  5825     "Created: / 25-01-2012 / 11:08:16 / cg"
  5815 !
  5826 !
  5816 
  5827 
  5817 withCRs
  5828 withCRs
  5818     "return a new string consisting of receivers characters
  5829     "return a new string consisting of receiver's characters
  5819      with all \-characters replaced by cr-characters."
  5830      with all \-characters replaced by cr-characters.
  5820 
  5831      If there are no backslashes, return the original"
       
  5832 
       
  5833     (self includes:$\) ifFalse:[^ self].
  5821     ^ self copyReplaceAll:$\ with:(Character cr)
  5834     ^ self copyReplaceAll:$\ with:(Character cr)
  5822 
  5835 
  5823     "
  5836     "
  5824      'hello\world' withCRs
  5837      'hello\world' withCRs
  5825     "
  5838     "
  6379      ('  ' , Character tab asString , ' foo   ') withoutTrailingSeparators inspect
  6392      ('  ' , Character tab asString , ' foo   ') withoutTrailingSeparators inspect
  6380      ('   foo' , Character tab asString) withoutTrailingSeparators inspect
  6393      ('   foo' , Character tab asString) withoutTrailingSeparators inspect
  6381     "
  6394     "
  6382 ! !
  6395 ! !
  6383 
  6396 
  6384 
       
  6385 !CharacterArray methodsFor:'substring searching'!
  6397 !CharacterArray methodsFor:'substring searching'!
  6386 
  6398 
  6387 findRangeOfString:subString
  6399 findRangeOfString:subString
  6388     "find a substring. if found, return the start- and endIndex;
  6400     "find a substring. if found, return the start- and endIndex;
  6389      if not found, return an empty interval."
  6401      if not found, return an empty interval."
  6966 ! !
  6978 ! !
  6967 
  6979 
  6968 !CharacterArray class methodsFor:'documentation'!
  6980 !CharacterArray class methodsFor:'documentation'!
  6969 
  6981 
  6970 version
  6982 version
  6971     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.537 2014-07-10 12:23:18 cg Exp $'
  6983     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.538 2014-07-10 23:57:07 cg Exp $'
  6972 !
  6984 !
  6973 
  6985 
  6974 version_CVS
  6986 version_CVS
  6975     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.537 2014-07-10 12:23:18 cg Exp $'
  6987     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.538 2014-07-10 23:57:07 cg Exp $'
  6976 ! !
  6988 ! !
  6977 
  6989 
  6978 
  6990 
  6979 CharacterArray initialize!
  6991 CharacterArray initialize!