.net 字符串倒转?

来源:百度知道 编辑:UC知道 时间:2024/06/07 12:20:26
例如:"48|45|13|2 " 如何倒转成"2|13|45|48" 呢?

在线等。。

string mytext="48,45,13,2";
string[] myarr = mytext.Split(',');
string op_text = "";
int i = myarr.Length;

while (i> 0)
{
op_text += myarr[i-1];
i--;
}
//输出 op_text 即为反的字符串 结果:2134548
Response.Write(op_text);
}