I am using the Flex SDK and able to capitalise the first letter of every word as follows:
textInput.text.toLowerCase().replace(/\b./g,function(...m):String{return m[0].toUpperCase()})
This works fine, however letters after punctuation are also being capitalised, which works in some cases (e.g. O'Neil) but not others (e.g. Connah'S Quay).
I want to have the code only look at letters at the start of a string and letters after a space. Can anyone provide the correct code to use in this instance please?
The output will be: I Am The King
If you prefer, try this regex:
This snippet might help:
Result is: