How to insert spaces between the characters of a string

后端 未结 4 579
醉酒成梦
醉酒成梦 2021-01-14 08:01

Is there an easy method to insert spaces between the characters of a string? I\'m using the below code which takes a string (for example ( UI$.EmployeeHours * UI.DailySalar

4条回答
  •  孤城傲影
    2021-01-14 08:34

    Well, you can do this by using Regular expressions, search for specific paterns and add brackets where needed. You could also simply Replace every Paranthesis with the same Paranthesis but with spaces on each end.

    I would also advice you to use StringBuilder aswell instead of appending to an existing string (this creates a new string for each manipulation, StringBuilder has a smaller memory footprint when doing this kind of manipulation)

提交回复
热议问题