Hello,
Can anyone please help me to split a string without a delimiter.
Example: OtherSupplierLogisticsDesign
to
Other
Supplier
Logistics
Design
String[] YourVariable = System.Text.RegularExpressions.Regex.Split("OtherSupplierLogisticsDesign", "(?<!^)(?=[A-Z])");
YourVariable
is an array type containing string items.
Later you can poll the array like so
YourVariable(0).ToString.Trim resulting in "Other"
YourVariable(1).ToString.Trim resulting in "Supplier"
YourVariable(2).ToString.Trim resulting in "Logistics"
YourVariable(3).ToString.Trim resulting in "Design"
So each of the purple piped lines will be places where the string will be split.
Reference : C# string.split() separate string by uppercase - Stack Overflow
8 Likes