Regular expression replace in C#

前端 未结 3 1807
清酒与你
清酒与你 2020-12-30 18:59

I\'m fairly new to using regular expressions, and, based on a few tutorials I\'ve read, I\'m unable to get this step in my Regex.Replace formatted properly.

Here\'s

3条回答
  •  情歌与酒
    2020-12-30 19:57

    Add the following 2 lines

    var regex = new Regex(Regex.Escape(","));
    sb_trim = regex.Replace(sb_trim, " ", 1);
    

    If sb_trim= John,Smith,100000,M the above code will return "John Smith,100000,M"

提交回复
热议问题