32 lines
946 B
Smalltalk
32 lines
946 B
Smalltalk
Extension { #name : #String }
|
|
|
|
{ #category : #'*Grafoscopio-Utils' }
|
|
String >> asCapitalizedPhrase [
|
|
"I convert phrases like 'THIS IS A PHRASE' into 'This is a Phrase'."
|
|
|
|
^ Character space join: (self substrings collect: [:each | each asLowercase capitalized ])
|
|
]
|
|
|
|
{ #category : #'*Grafoscopio-Utils' }
|
|
String >> correctAccentedCharacters [
|
|
|
|
| output |
|
|
output := self
|
|
copyReplaceAll: 'ó' with: 'ó'.
|
|
output := output copyReplaceAll: 'á' with: 'á'.
|
|
output := output copyReplaceAll: 'é' with: 'é'.
|
|
output := output copyReplaceAll: 'Ã' with: 'í'.
|
|
output := output copyReplaceAll: 'ú' with: 'ú'.
|
|
output := output copyReplaceAll: 'ñ' with: 'ñ'.
|
|
output := output copyReplaceAll: 'â' with: '“'.
|
|
output := output copyReplaceAll: 'â' with: '”'.
|
|
^ output
|
|
]
|
|
|
|
{ #category : #'*Grafoscopio-Utils' }
|
|
String >> isOrgModeHeader [
|
|
^ self beginsWithAnyOf: #('* ' '** ' '*** ' '**** ' '***** ' '***** ')
|
|
|
|
|
|
]
|