zoukankan      html  css  js  c++  java
  • asp.net常用字符串函数

    /// <summary>
            /// 提取字符串中的数字
            /// </summary>
            /// <param name="str"></param>
            /// <returns></returns>
            public static string getNumber(string str)
            {
                return System.Text.RegularExpressions.Regex.Replace(str, @"[^d{2}-]*", "");
            }
    

      截取字符串:原字符:{Width=300, Height=200}

    size = size.Replace("{Width=", "");//替换
    size = size.Replace(" Height=", "");
    size = size.Substring(0, size.Length - 1);//去掉最后一个
    

      截取之后:300,200

  • 相关阅读:
    111
    实验 12 综合练习二
    实验 11结构体
    作业 5 指针应用1
    实验 10 指针2
    实验9 指针1
    实验8 数组2
    实验7
    321
    实验9-2
  • 原文地址:https://www.cnblogs.com/hllive/p/5532163.html
Copyright © 2011-2022 走看看