There is a method that inserts spaces before capital letters. There is an error: in 1 method call, the space is set only 1 time, even if there are a lot of capital letters.
BreakCamelCase("вывыВвывывы"); BreakCamelCase("вывыВвывDывы"); Expected to receive in response:
outflows
wyv vvyv dyvy
I receive:
outflows
VyVyvvyv Dyvy
Code:
public static string BreakCamelCase(string str) { string n = null; for(int i = 0; i < str.Length;i++) { if (Char.IsUpper(str[i])) { n = str.Insert(i, ' '.ToString()); } } return n; }