c#中字符串的反转部分 [英] reverse part of string in c#
问题描述
如何反转部分用户输入字符串?
How can I reverse part of user input string?
只是数字不应该反转所有其他部分必须反转。
just number should not reverse all other part must reverse.
这是一个示例:
Here is a sample:
abcdefgh --> hgfedcba
ABC123DEF - > CBA123FED
DISK0123CAR - > KSID0123RAC
596ABCDEF - > 596FEDCBA
ABC123DEF --> CBA123FED
DISK0123CAR --> KSID0123RAC
596ABCDEF --> 596FEDCBA
无法控制输入,用户输入可以是任何内容,最大长度为20个字符。
no control on input, user input can be anything, the max length is 20 character.
提前谢谢
推荐答案
那个话题提出了不同的东西"我有一个小小的任务,就像我只想使用c#来反转字符串的某些部分。因为我想要反转
两个完整停止之间的字符串(。) 。"
that topic ask deferent thing "i have small task like i want to reverse some portion of string only using c#. for ex i want to reverse the string in between two fullstops(.)."
但我的字符串不包含fullstops。我想反转字符串的非数字部分。
这篇关于c#中字符串的反转部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!