CharacterArray.st
changeset 5510 a261b8f5d66f
parent 5487 cb4c5ae75c63
child 5609 7ecaa8d824fe
equal deleted inserted replaced
5509:c0277123fe4a 5510:a261b8f5d66f
  2964     "
  2964     "
  2965      'foobarbaz' sameCharacters: 'foo'   
  2965      'foobarbaz' sameCharacters: 'foo'   
  2966      'foobarbaz' sameCharacters: 'Foo'   
  2966      'foobarbaz' sameCharacters: 'Foo'   
  2967      'foobarbaz' sameCharacters: 'baz'   
  2967      'foobarbaz' sameCharacters: 'baz'   
  2968     "
  2968     "
       
  2969 !
       
  2970 
       
  2971 sameEmphasisAs:aStringOrText
       
  2972     "compare the receivers and the arguments emphasis"
       
  2973 
       
  2974     ^ self emphasis = aStringOrText emphasis
       
  2975 
       
  2976     "
       
  2977      'hello' asText sameEmphasisAs: 'hello'         
       
  2978      'hello' asText sameEmphasisAs: 'hello' asText  
       
  2979      'hello' asText allBold sameEmphasisAs: 'hello' 
       
  2980      'hello' asText allBold sameEmphasisAs: 'fooba' asText allBold  
       
  2981      'hello' asText allBold sameEmphasisAs: 'fooba' asText allItalic  
       
  2982     "
       
  2983 
       
  2984 
       
  2985 !
       
  2986 
       
  2987 sameStringAndEmphasisAs:aStringOrText
       
  2988     "compare the receivers and the arguments emphasis and string"
       
  2989 
       
  2990     aStringOrText isString ifFalse:[^ false].
       
  2991     (self string = aStringOrText string) ifFalse:[^ false].
       
  2992     self hasChangeOfEmphasis = aStringOrText hasChangeOfEmphasis ifFalse:[^ false].
       
  2993     ^ self emphasis = aStringOrText emphasis
       
  2994 
       
  2995     "
       
  2996      'hello' asText sameEmphasisAs: 'hello'         
       
  2997      'hello' asText sameEmphasisAs: 'hello' asText  
       
  2998      'hello' asText allBold sameEmphasisAs: 'hello' 
       
  2999      'hello' asText allBold sameEmphasisAs: 'fooba' asText allBold  
       
  3000      'hello' asText allBold sameEmphasisAs: 'fooba' asText allItalic  
       
  3001 
       
  3002      'hello' sameEmphasisAs: 'hello' asText         
       
  3003      'hello' sameEmphasisAs: 'hello' asText allBold  
       
  3004      'hello' sameEmphasisAs: 'fooba'                 
       
  3005      'hello' sameEmphasisAs: 'fooba' asText          
       
  3006      'hello' sameEmphasisAs: 'fooba' asText allBold  
       
  3007      'hello' sameEmphasisAs: 'fooba' asText allItalic  
       
  3008 
       
  3009      'hello' asText sameStringAndEmphasisAs: 'hello'           
       
  3010      'hello' asText sameStringAndEmphasisAs: 'hello' asText    
       
  3011      'hello' asText allBold sameStringAndEmphasisAs: 'hello'   
       
  3012      'hello' asText allBold sameStringAndEmphasisAs: 'fooba' asText allBold  
       
  3013      'hello' asText allBold sameStringAndEmphasisAs: 'fooba' asText allItalic  
       
  3014 
       
  3015      'hello' sameStringAndEmphasisAs: 'hello' asText                         
       
  3016      'hello' sameStringAndEmphasisAs: 'hello' asText allBold                 
       
  3017      'hello' sameStringAndEmphasisAs: 'fooba'                                
       
  3018      'hello' sameStringAndEmphasisAs: 'fooba' asText                         
       
  3019      'hello' sameStringAndEmphasisAs: 'fooba' asText allBold  
       
  3020      'hello' sameStringAndEmphasisAs: 'fooba' asText allItalic  
       
  3021     "
       
  3022 
       
  3023 
  2969 ! !
  3024 ! !
  2970 
  3025 
  2971 !CharacterArray methodsFor:'converting'!
  3026 !CharacterArray methodsFor:'converting'!
  2972 
  3027 
  2973 asArrayOfSubstrings
  3028 asArrayOfSubstrings
  4420     "
  4475     "
  4421 
  4476 
  4422     "Created: 12.5.1996 / 20:09:29 / cg"
  4477     "Created: 12.5.1996 / 20:09:29 / cg"
  4423     "Modified: 17.4.1997 / 12:50:23 / cg"
  4478     "Modified: 17.4.1997 / 12:50:23 / cg"
  4424 ! !
  4479 ! !
  4425 
       
  4426 
  4480 
  4427 !CharacterArray methodsFor:'special string converting'!
  4481 !CharacterArray methodsFor:'special string converting'!
  4428 
  4482 
  4429 chopTo:maxLen
  4483 chopTo:maxLen
  4430     "if the receivers size is less or equal to maxLen, return it.
  4484     "if the receivers size is less or equal to maxLen, return it.
  5553 ! !
  5607 ! !
  5554 
  5608 
  5555 !CharacterArray class methodsFor:'documentation'!
  5609 !CharacterArray class methodsFor:'documentation'!
  5556 
  5610 
  5557 version
  5611 version
  5558     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.186 2000-07-29 09:03:43 cg Exp $'
  5612     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.187 2000-08-09 21:30:53 cg Exp $'
  5559 ! !
  5613 ! !
  5560 CharacterArray initialize!
  5614 CharacterArray initialize!