Parsing out and replacing "Word space lower case word" to "CamelCase" two words combined with capitals

I have a csv with the following:
"(space)Comparing concepts; Solving problems;

I want
(noSpace)ComparingConcepts;SolvingProblems;

I would like to remove the spaces at the beginning of the first word AND between the words, then combine and capitalize the two words… like so Word1Word2

How do I do this with regex?
This is what I have tried but it is not working.

x=x.format.trim.replace(“\s([a-z])”,$1);

Obviously, I have a RegEx gap.

Thanks
Tom

I put your start example in the $Text of a note and added an empty root-level note ‘output’ . I then used this stamp:

var:list vList = $Text;
var:string vString;
vList.each(anItem){
   vString+=anItem.capitalize.replace(" ","")+";";
};
$Text(/output) = vString;

The text in ‘output’ is now: ComparingConcepts;SolvingProblems;.

There might be more elegant ways, but the real starting and ending data type is not specified but the above works.

2 Likes

You are a genius!!!