public class BaseTest
{
public static void Chapter6()
{
Console.WriteLine("Please enter a message:");
string msg = Console.ReadLine();
Console.WriteLine("Reverse the English message and add double quote:");
string msg2 = "";
for (int i = msg.Length - 1; i >=0; i--)
{
msg2 += msg[i];
}
msg2 = "\"" + msg2.Replace(" ", "\" \"") + "\"";
Console.WriteLine(msg2);
Console.ReadKey();
}
}
入门经典学习1字符串操作
最新推荐文章于 2022-03-19 12:14:29 发布