CharacterArray.st
changeset 8025 04d9b6ef3012
parent 8024 93db40068fba
child 8026 96cc838078ba
equal deleted inserted replaced
8024:93db40068fba 8025:04d9b6ef3012
  3327 
  3327 
  3328     firstChar := (self at:1).
  3328     firstChar := (self at:1).
  3329     firstCharAsLowercase := firstChar asLowercase.
  3329     firstCharAsLowercase := firstChar asLowercase.
  3330     firstChar == firstCharAsLowercase ifTrue:[ ^ self].
  3330     firstChar == firstCharAsLowercase ifTrue:[ ^ self].
  3331 
  3331 
       
  3332     "/ mhmh - the code below assumes, that the titlecase character NEVER has
       
  3333     "/ a smaller bitsPerCharacter value. Is this true ?
  3332     newString := firstCharAsLowercase stringSpecies fromString:self.
  3334     newString := firstCharAsLowercase stringSpecies fromString:self.
  3333     newString at:1 put:firstCharAsLowercase.
  3335     newString at:1 put:firstCharAsLowercase.
  3334     ^ newString
  3336     ^ newString
  3335 
  3337 
  3336     "
  3338     "
  3583      receiver."
  3585      receiver."
  3584 
  3586 
  3585     |newString firstChar firstCharAsTitlecase|
  3587     |newString firstChar firstCharAsTitlecase|
  3586 
  3588 
  3587     firstChar := (self at:1).
  3589     firstChar := (self at:1).
  3588     firstCharAsTitlecase := firstChar asUppercase.
  3590     firstCharAsTitlecase := firstChar asTitlecase.
  3589     firstChar == firstCharAsTitlecase ifTrue:[ ^ self].
  3591     firstChar == firstCharAsTitlecase ifTrue:[ ^ self].
  3590 
  3592     "/ mhmh - the code below assumes, that the titlecase character NEVER has
       
  3593     "/ a smaller bitsPerCharacter value. Is this true ?
  3591     newString := firstCharAsTitlecase stringSpecies fromString:self.
  3594     newString := firstCharAsTitlecase stringSpecies fromString:self.
  3592     newString at:1 put:firstCharAsTitlecase.
  3595     newString at:1 put:firstCharAsTitlecase.
  3593     ^ newString
  3596     ^ newString
  3594 
  3597 
  3595     "
  3598     "
  3596      'helloWorld' asTitlecaseFirst 
  3599      'helloWorld' asTitlecaseFirst   
  3597      'HelloWorld' asTitlecaseFirst   
  3600      'HelloWorld' asTitlecaseFirst   
  3598     "
  3601     "
  3599 !
  3602 !
  3600 
  3603 
  3601 asTwoByteString
  3604 asTwoByteString
  3654 
  3657 
  3655     firstChar := (self at:1).
  3658     firstChar := (self at:1).
  3656     firstCharAsUppercase := firstChar asUppercase.
  3659     firstCharAsUppercase := firstChar asUppercase.
  3657     firstChar == firstCharAsUppercase ifTrue:[ ^ self].
  3660     firstChar == firstCharAsUppercase ifTrue:[ ^ self].
  3658 
  3661 
       
  3662     "/ mhmh - the code below assumes, that the titlecase character NEVER has
       
  3663     "/ a smaller bitsPerCharacter value. Is this true ?
  3659     newString := firstCharAsUppercase stringSpecies fromString:self.
  3664     newString := firstCharAsUppercase stringSpecies fromString:self.
  3660     newString at:1 put:firstCharAsUppercase.
  3665     newString at:1 put:firstCharAsUppercase.
  3661     ^ newString
  3666     ^ newString
  3662 
  3667 
  3663     "
  3668     "
  6278 ! !
  6283 ! !
  6279 
  6284 
  6280 !CharacterArray class methodsFor:'documentation'!
  6285 !CharacterArray class methodsFor:'documentation'!
  6281 
  6286 
  6282 version
  6287 version
  6283     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.288 2004-03-01 20:57:43 cg Exp $'
  6288     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.289 2004-03-01 20:59:24 cg Exp $'
  6284 ! !
  6289 ! !
  6285 
  6290 
  6286 CharacterArray initialize!
  6291 CharacterArray initialize!