Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sortinfo = sortinfo.Remove(0, 500);
- sortinfo = new string(sortinfo.SkipWhile(c => !char.IsDigit(c)).ToArray());
- class Program
- {
- static void Main(string[] args)
- {
- string str;
- str=TrimSortInfo("23:value,ord4er24:valueag4ain,order6again15:value,order"); // breaking value
- //str = TrimSortInfo("23:value,order24:valueagain,orderagain15:value,order"); //working value
- Console.WriteLine(str);
- Console.ReadLine();
- }
- static string TrimSortInfo(string sortinfo)
- {
- if (sortinfo.Length > 15)
- {
- sortinfo = sortinfo.Remove(0, 15);
- sortinfo = new string(sortinfo.SkipWhile(c => !char.IsDigit(c))
- .ToArray());
- return sortinfo;
- }
- return sortinfo;
- }
- }
Add Comment
Please, Sign In to add comment