Hi, I have been struggling to rename a group of files by trying to eliminate the whitespace between 2 words in a $Name. In other words, I would like to rename a document by eliminating the white space between the words.
For example:$Name== “Word1 Word2 Word3” wanting to rename to $Name==“Word1Word2”
How do I remove whitespaces between words in a $Name?
Excellent, thanks Mark, this works perfectly in my example above. Thank you. I am just beginning to use the “replace” operator. This helps.
I have a follow up slightly more expanded question. I am trying to convert some title names in an older tinderbox file from word1 word2 word3 word3 to CamelCase format. In my example, how do I remove the whitespaces in all the words AND capitalize each word?
Example
“this is my old file name” to “ThisIsMyOldFileName”
So, we split the original $Name into words, based on the premise of a single space between words.
Then we set $MyString (or in your case $Name) to be the capitalised versions of word 1 and word two concatenated to a single string. Then we reset $MyList to default so we don’t save any cruft.