Remove last specific character in a string c#

前端 未结 8 1398
梦谈多话
梦谈多话 2020-12-13 23:16

I use WinForms c#.I have string value like below,

string Something = \"1,5,12,34,\";

I need to remove last comma in a string. So How can i

8条回答
  •  忘掉有多难
    2020-12-13 23:26

    Or you can convert it into Char Array first by:

    string Something = "1,5,12,34,";
    char[] SomeGoodThing=Something.ToCharArray[];
    

    Now you have each character indexed:

    SomeGoodThing[0] -> '1'
    SomeGoodThing[1] -> ','
    

    Play around it

提交回复
热议问题