zoukankan      html  css  js  c++  java
  • 分别获取一个字符串中的字母和数字

     string    str20   =   "ABC123";   
     string   strSplit1=string.Empty;
     string   strSplit2=string.Empty;   
        
      //取出字符串中所有的数字   
      strSplit1   =   Regex.Replace(str20,"[a-z]","",RegexOptions.IgnoreCase);   
    
    
      //取出字符串中所有的英文字母   
      strSplit2   =   Regex.Replace(str20,"[0-9]","",RegexOptions.IgnoreCase);  
    

     这个方法挺实用的,解决了很多动态生成序列号一系列问题;

  • 相关阅读:
    jsp4个作用域
    jsp9个内置对象
    jsp指令
    jsp注释
    jsp原理
    java面试
    代理
    泛型
    exception
    基础
  • 原文地址:https://www.cnblogs.com/BraveBoy/p/7412773.html
Copyright © 2011-2022 走看看