110,539
社区成员
发帖
与我相关
我的任务
分享
char[] testSplit ={'|',','};
string Number="1|245|375|4|5|68|89|95,111243,435345,00987";
string[] str = Number.Split(testSplit);
foreach (string s in str)
{
Console.WriteLine(s);
}
static void Main(string[] args)
{
//decimal dec = decimal.Parse("231");
//Console.Write(dec.ToString("00000000"));
string str = "78945.123456";
int nIndex = str.IndexOf(".");
string[] arr = new string[str.Length];
for (int i = 0; i < str.Length; i++)
{
if (i != nIndex)
{
arr[i] = str[i].ToString();
}
}
foreach (string s in arr)
{
Console.Write(s);
}
Console.WriteLine(nIndex.ToString());
}
string str = " ¦1 ¦ ¦2 ¦ ¦3 ¦ ¦4 ¦ ¦5 ¦ ¦6 ¦ ¦7 ¦ ¦8 ¦ ¦9 ¦ ¦10 ¦";
foreach (string strnumber in str.Split('¦'))
{
Console.WriteLine(strnumber);
}