码迷,mamicode.com
首页 > 编程语言 > 详细

java实现不区分大小写替换

时间:2015-01-15 19:44:36      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:

/** 
  * java实现不区分大小写替换 
  * @param source 
  * @param oldstring 
  * @param newstring 
  * @return 
  */ 
public static String IgnoreCaseReplace(String source, String oldstring, 
   String newstring){ 
      Pattern p = Pattern.compile(oldstring, Pattern.CASE_INSENSITIVE); 
      Matcher m = p.matcher(source); 
      String ret=m.replaceAll(newstring); 
      return ret; 

java实现不区分大小写替换

标签:

原文地址:http://www.cnblogs.com/wk022/p/4226858.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!