2020-05-02 13:28:13 +00:00
|
|
|
Extension { #name : #String }
|
|
|
|
|
|
|
|
{ #category : #'*Grafoscopio-Utils' }
|
|
|
|
String >> asCapitalizedPhrase [
|
2020-08-07 19:03:08 +00:00
|
|
|
"I convert phrases like 'THIS IS A PHRASE' into 'This is a Phrase'."
|
2020-05-02 13:28:13 +00:00
|
|
|
|
|
|
|
^ Character space join: (self substrings collect: [:each | each asLowercase capitalized ])
|
|
|
|
]
|
|
|
|
|
2020-08-07 19:03:08 +00:00
|
|
|
{ #category : #'*Grafoscopio-Utils' }
|
|
|
|
String >> asDashedLowercase [
|
|
|
|
"I convert phrases like 'This is a phrase' into 'this-is-a-phrase'."
|
|
|
|
|
|
|
|
^ '-' join: (self substrings collect: [:each | each asLowercase ])
|
|
|
|
]
|
|
|
|
|
2020-10-08 22:36:52 +00:00
|
|
|
{ #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
|
|
|
|
]
|
|
|
|
|
2020-05-02 13:28:13 +00:00
|
|
|
{ #category : #'*Grafoscopio-Utils' }
|
|
|
|
String >> isOrgModeHeader [
|
|
|
|
^ self beginsWithAnyOf: #('* ' '** ' '*** ' '**** ' '***** ' '***** ')
|
|
|
|
|
|
|
|
|
|
|
|
]
|