摘要:
class Program { static void Main(string[] args) { string str = Console.ReadLine(); str = str.Insert(1, "@@@"); Console.WriteLine("新字符串为:" + str); } } 阅读全文
posted @ 2019-12-23 13:40
highlightyys
阅读(675)
评论(0)
推荐(0)
摘要:
class Program { static void Main(string[] args) { string str = Console.ReadLine(); int firstIndex = str.IndexOf("@"); int lastIndex = str.LastIndexOf( 阅读全文
posted @ 2019-12-23 13:38
highlightyys
阅读(67)
评论(0)
推荐(0)
摘要:
class Program { static void Main(string[] args) { string str = Console.ReadLine(); if (str.IndexOf(",") != -1) { str = str.Replace(",", "_"); } Consol 阅读全文
posted @ 2019-12-23 10:12
highlightyys
阅读(81)
评论(0)
推荐(0)
摘要:
使用 IndexOf 方法查找第一个 @ 出现的位置与使用 LastlndexOf 方法查找 @ 在字符串中最后一次出现的位置相同即可 class Program { static void Main(string[] args) { string str = Console.ReadLine(); 阅读全文
posted @ 2019-12-23 10:09
highlightyys
阅读(37)
评论(0)
推荐(0)

浙公网安备 33010602011771号