This is how I approached the problem statement. I inserted a delimiter (space) before a uppercase character and used 'Split Text' action from the Utility Strings VBO to make the string in to collection.
You need a code stage for executing the regex.
Add below Namespaces to 'Code Options' Tab on the Initialize page of the object-
System.Text
System.Text.RegularExpressions
Global Code:
C#:
public string AddSpacesToString(string text)
{
return Regex.Replace(text, @"((?<=\p{Ll})\p{Lu})|((?!\A)\p{Lu}(?>\p{Ll}))", " $0");
}
Now, call the above function with Code stage:
- Start
- Code Stage:
- Under Inputs tab, have an input parameter of Text type. Lets say input string 'inputStr'
- Under Outputs tab, have an output parameter of Text type. Lets say input string 'outputStr'
- Under Code tab:
outputStr = AddSpacesToString(inputStr);
- 'Split Text' action from Strings VBO
- Inputs:
- Text to Split: [outputStr]
- Split Char: " "
- Collection Field Name: "Values"
- Output:
- End
On execution of the above flow, you will have the 'SplitCol' with the desired output.
Post back how it goes.