您的位置:首页 > 其它

入门经典学习1字符串操作

2017-12-21 14:11 246 查看
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();
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: