Remove text after a string occurrence

后端 未结 5 1083
温柔的废话
温柔的废话 2021-01-19 05:38

I have a string that has the following format:

string sample = \"A, ABC, 1, ACS,,\"

As you can see, there are 5 occurences of the ,

5条回答
  •  死守一世寂寞
    2021-01-19 06:29

    You could use a string.replace if it is always two commas at the end

    http://msdn.microsoft.com/en-us/library/fk49wtc1.aspx

提交回复
热议问题