交换字符串中的两个数字
我有一个包含两个数字和一些文本的字符串。我想交换这两个数字,例如。 “22-33”在第二个字符串中将是“33-22”。这可能吗?
该字符串将包含不同的数字,但每个数字仅包含两个数字,并且它们将保留在字符串中的相同位置。
有谁可以帮助我吗?
I have a string that contains two numbers and some text. I want to swap the two numbers with each other, ex. "22-33" will be "33-22" in a second string. Is that possible?
The string will be with different numbers, but only with two digts each and they will stay at the same place in the string.
Anyone that can help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然,首先像这样分割它们:
Sure just split them first like this: