كود لتقطيع ال string
جزاكم الله خيرا
كود لتقطيع ال string
جزاكم الله خيرا
using System;
class MC
{
static void Main()
{
// String By Using Array
string a="hello CSharp";
char f1= a[2];
Console.WriteLine(f1);
// Some String Functions Try it you can know it's Function
string b="c is great";
string b2=b.Insert(2,"sharp");
Console.WriteLine(b2);
string msg="hello";
int c=msg.Length;
Console.WriteLine(c);
string d="hello";
string d2=string.Copy (d);
Console.WriteLine(d2);
string e=string.Concat ("a","b","c","d");
Console.WriteLine(e);
string e2=string.Concat ("a"+"b"+"c"+"d");
Console.WriteLine(e2);
string e3 = "a"+"b"+"c"+"d";
Console.WriteLine(e3);
}
}
// For More Information Search on MSDNتم تعديل هذه المشاركة بواسطة fmo_82 في 5 أكتوبر 2005 في 13:54
yourString.Split(char[]delimiters); /*delimiters is an array of chars ,each element in the array is a delimiter which is the character(s) at which you want to split your string */
تم تعديل هذه المشاركة بواسطة IOException في 5 أكتوبر 2005 في 15:05
جزاكم الله خيرا
أريد أن اعمل split من حيث عدة characters
قم بعمل Array من الـ Chars وضع بها كل الـ Characters التي تريد عمل الـ Split على أساسها.
string myString = "Moutaz Shams";
char[] myChars = new char[]{'M',' ','h'};
string[] ayHaga = myString.Split(myChars);جزاكم الله خيرا
هذا الموضوع مغلق.