How to insert spaces between characters using Regex?

后端 未结 3 963
花落未央
花落未央 2020-12-16 03:32

Trying to learn a little more about using Regex (Regular expressions). Using Microsoft\'s version of Regex in C# (VS 2010), how could I take a simple string like:

         


        
3条回答
  •  旧巷少年郎
    2020-12-16 04:10

    It's very simple. To match any character use . dot and then replace with that character along with one extra space

    Here parenthesis (...) are used for grouping that can be accessed by $index

    Find what : "(.)"

    Replace with "$1 "

    DEMO

提交回复
热议问题