int count = 0;
string[] arrch;
string[] arrchname;
bool skip = true;
if ((arrch = this.Request["chnames"].Trim(trims).Split(sep)) != null)
{
arrchname = this.Request["chnames"].Trim(trims).Split(sep); for (int i = 0; i < arrch.Length; i++)
{
string chid = arrch[i];
string chname = arrchname[i];
int n = Convert.ToInt32(chid);这里转换说字符串格式不正确
arrch里面存的是最上面那种格式的数据 求解决方法 或有什么办法只去括号里面数字?
string[] arrch;
string[] arrchname;
bool skip = true;
if ((arrch = this.Request["chnames"].Trim(trims).Split(sep)) != null)
{
arrchname = this.Request["chnames"].Trim(trims).Split(sep); for (int i = 0; i < arrch.Length; i++)
{
string chid = arrch[i];
string chname = arrchname[i];
int n = Convert.ToInt32(chid);这里转换说字符串格式不正确
arrch里面存的是最上面那种格式的数据 求解决方法 或有什么办法只去括号里面数字?
/// 去掉字符串中的数字
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static string RemoveNumber(string key)
{
return System.Text.RegularExpressions.Regex.Replace(key, @"\d", "");
} /// <summary>
/// 去掉字符串中的非数字
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static string RemoveNotNumber(string key)
{
return System.Text.RegularExpressions.Regex.Replace(key, @"[^\d]*", "");
}