标题:无法打印字符串,提示索引错误。substring
只看楼主
高逆水行舟
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2016-3-19
结帖率:100%
已结贴  问题点数:10 回复次数:1 
无法打印字符串,提示索引错误。substring
string poetry = "日照香炉生紫烟,遥看瀑布观前川,飞流直下三千尺,疑是银河落九天。\n";
                 int i=1, j=1,z=0;
                 string [] s = new string[4] ;
                 string char1= "";
                 char1 = "";
                 char1 = "poetry .Substring (1,2)";
                 Console.Write("{1}/n", char1);
2016-10-22 15:50
ak1ca
Rank: 2
等 级:论坛游民
帖 子:3
专家分:20
注 册:2008-7-3
得分:10 
char1 = poetry .Substring (1,2); //错误,不用引号
 Console.Write("{0}/n", char1);  //错误,从0开始
2016-10-26 11:08



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-470105-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.382289 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved