国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

String類使用的例子(3)

2019-11-18 15:21:13
字體:
來源:轉載
供稿:網友

  if ("first"==strFL)
Console.WriteLine("The index value returned is : "+ objString.str.IndexOfAny(c,intStart));

else
Console.WriteLine("The index value returned is : "+ objString.str.LastIndexOfAny(c,intStart));

break;
case 3:
Console.Write("Enter the string for the character array :");
strChar=Console.ReadLine();
c=strChar.ToCharArray();
Console.Write("Enter the starting Index for search :");
intStart=int.Parse(Console.ReadLine());
Console.Write("Enter the number of characters to searc :");
intCount=int.Parse(Console.ReadLine());
if ("first"==strFL)
Console.WriteLine("The index value returned is : "+ objString.str.IndexOfAny(c,intStart,intCount));

else
Console.WriteLine("The index value returned is : "+ objString.str.LastIndexOfAny(c,intStart,intCount));

break;
case 4:
blnStay=false;
break;
}
if (blnStay)
mtdIndexAnyImpl(strValue,strFL);
}

PRivate void mtdInsert() {
Console.WriteLine("String.Insert(int index,string str) - > this functions returns the original string with ‘str‘ inserted at ‘index‘");

Console.WriteLine("the original string : " + objString.str);
Console.Write("Enter the string to be inserted : ");
string strTmp=Console.ReadLine();
Console.Write("Enter the position where it has to be inserted :");
int intTmp=int.Parse(Console.ReadLine());
objString.str=objString.str.Insert(intTmp,strTmp);
Console.WriteLine("the modified string : " + objString.str);
}

private void mtdJoin() {
string[] s=;
Console.WriteLine("1.String.Join(string str,string[] strarr) - > this functions joins the string arrays using ‘str‘");

Console.WriteLine("2.String.Join(string str,string[] strarr,int i,int j) - > this functions joins the string arrays using ‘str‘ starting from the ‘i‘ th array element and ‘j‘ number of elements after it. ");

Console.Write("Enter your choice :");
string strChoice=Console.ReadLine();
if ("1"==strChoice) {
Console.WriteLine("The string array is :str[0]=‘welcome‘,str[1]=‘to‘,str[2]=‘the‘,str[3]=‘world‘,str[4]=‘of‘,str[5]=‘c#‘");

Console.Write("Enter the string with which to join : ");
string strTmp=Console.ReadLine();
Console.WriteLine("The joint string is : " + String.Join(strTmp,s));
}
else {
Console.WriteLine("The string array is :str[0]=‘welcome‘,str[1]=‘to‘,str[2]=‘the‘,str[3]=‘world‘,str[4]=‘of‘,str[5]=‘c#‘");

Console.Write("Enter the string with which to join : ");
string strTmp=Console.ReadLine();
Console.Write("Enter the starting index of the array : ");
int intStart=int.Parse(Console.ReadLine());
Console.Write("Enter the number of elements to join :" );
int intCount=int.Parse(Console.ReadLine());
Console.WriteLine("The joint string is : " + String.Join(strTmp,s,intStart,intCount));



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 红安县| 勐海县| 辽源市| 台中县| 大洼县| 昭通市| 分宜县| 宜良县| 聂拉木县| 普格县| 宜兰县| 宾川县| 益阳市| 陵水| 龙里县| 神农架林区| 确山县| 太保市| 离岛区| 卓尼县| 玉屏| 雷波县| 新巴尔虎右旗| 平遥县| 沅陵县| 长乐市| 开远市| 汪清县| 锡林浩特市| 介休市| 昌平区| 双柏县| 霍山县| 扶余县| 甘德县| 搜索| 怀化市| 克拉玛依市| 南雄市| 马关县| 巴楚县|