
many thx for your help

i dont know how this works but it works

if you want to explain it so that i also understand it.....
Moderator: Martin
Code: Select all
regexp = '(?<=\\W)|(?=\\W)'; // expression to get the parts of overall text (including words and spaces)
words = split(text, regexp); // split text by expression
result = ''; // make buffer
for(word in words) { // loop over each part of text
firstLetter = toUpperCase(left(word,1)); // get first 1 symbol from left side of "word" and uppercase it
rest = toLowerCase(substring(word,1)); // get rest of the "word" and lowercase it for your needs (tEsT -> Test)
result = "{result}{firstLetter}{rest}"; // concatenate previous buffer, first letter and the rest to get overall string pretty formatted for your needs
}
log(text);
log(result);