Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static string ReverseSubString(string st)
- {
- string subSt;
- int i = 0, nextI;
- while (i < st.Length)
- {
- nextI = st.IndexOf('0', i);
- subSt = st.Substring(i, nextI - i);
- st = st.Replace(subSt, ReverseString(subSt));
- i = nextI + 1;
- }
- return st;
- }
- public static string ReverseString(string st)
- {
- string newSt = "";
- for (int i = st.Length - 1; i > -1; i--)
- newSt += st[i];
- return newSt;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement