zoukankan      html  css  js  c++  java
  • C#提取字符串中的数字字符串

    1  /// <summary>
     2  /// 提取字符串中的数字字符串
     3
     /// </summary>
     4  /// <param name="str"></param>
     5 /// <returns></returns>
     6  public static string IsNumber(String str)
     7
      {
     8
                 string returnStr = string.Empty;
     9
                 for (int i = 0; i < str.Length; i++)
    10
                 {
    11
                     if (Char.IsNumber(str, i) == true)
    12
                     {
    13
                         returnStr += str.Substring(i, 1);
    14
                     }
    15
                     else
    16                 {
    17
                         if (str.Substring(i, 1== "A" || str.Substring(i, 1== " ")
    18
                         {
    19
                             returnStr += str.Substring(i, 1);
    20
                         }
    21
                     }
    22
     
    23             }
    24
                 return returnStr;
    25
     }

  • 相关阅读:
    PHP命名空间
    php各个版本的区别
    MySQL的读写分离---主从复制、主主复制
    redis的安装和php的redis扩展
    php的设计模式
    git命令详情
    memcache和redis的对比
    mysql性能优化
    MySQL的分区、分表、集群
    nginx的反向代理和负载均衡
  • 原文地址:https://www.cnblogs.com/wwwzzg168/p/3572028.html
Copyright © 2011-2022 走看看