Add one space after every two characters and add a character infront of every single character

后端 未结 4 767
甜味超标
甜味超标 2021-01-20 04:05

I want to add one space after every two characters, and add a character in front of every single character.

This is my code:

string str2;
str2 = str1         


        
4条回答
  •  无人及你
    2021-01-20 04:29

    May be you can try, if i right understand your request,

    String.Length % 2
    

    if result is 0, you done with first iteration, if not, just add a character infront of last one.

提交回复
热议问题