Add spaces to string using it's capital / upper case letters

Hey there,

This is kind of messy but it works

So first we take the input string and make two separate arrays, one as it is, and one as all lowercase, using the Get Character Array from String function.
Then we for loop through the original array, and we check each character (array element) against the same character (array element) of the lower case string (It’s important to use the String == String and not the Case Insensitive version of the same node) If False, we know we have run into a capital character, so in that case, we add a new array element to the array of “Individual Words”, and we set the “Individual Word Number” integer to the index that we just added to the array. Then for every character that IS = to the other character, we know we have found a lower case character, so append that character to the same array element we just added, until we find another capital letter, and then start the process again. When the loop is completed, we join all those individual words from the array, into one string, with the separator of just a blank character, and print it.

Now it’s worth noting that this currently wont work if your first character is not a capital letter. Ill have to think a little more about how to deal with that case, but I hope this gets you started

Cheers

EDIT: I added a little bit of logic to account for your first letter not being capital Here: Pascal Case Seperator Fixed posted by anonymous | blueprintUE | PasteBin For Unreal Engine 4
if you needed to capitalise your first letter you could just do a to upper node

1 Like