GrafoscopioUtils/repository/Grafoscopio-Utils/String.extension.st

16 lines
410 B
Smalltalk
Raw Normal View History

2020-05-02 13:28:13 +00:00
Extension { #name : #String }
{ #category : #'*Grafoscopio-Utils' }
String >> asCapitalizedPhrase [
"I convert phrases like 'THIS IS A PHASE' into 'This is a Phrase'."
^ Character space join: (self substrings collect: [:each | each asLowercase capitalized ])
]
{ #category : #'*Grafoscopio-Utils' }
String >> isOrgModeHeader [
^ self beginsWithAnyOf: #('* ' '** ' '*** ' '**** ' '***** ' '***** ')
]