我有一个类似于98abcd123fgh324ijklm564asd的字符串。我想在字符串中每个数字的前后插入几个空格。下面是示例输出:
98abcd123fgh324ijklm564asd
str = "98abcd123fgh324ijklm564asd" required_function(str) # " 98 abcd 123 fgh 324 ijklm 564 asd"
js4nwp541#
str = "98abcd123fgh324ijklm564asd" gsub("(\\d+)", " \\1 ", str)
1条答案
按热度按时间js4nwp541#