由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - wrong!!! Re: 有没有 replaceall for String?
相关主题
Re: wrong!!! Re: 有没有 replaceall for Strijava str.replaceAll("\n", "") doesn't work
有没有 replaceall for String?如何确保每次读入的字符串都是unique的
why doesn't replaceAll work?Help me: jsp tag 问题
问个String:replaceALL的问题Re: JTextArea的内容不滚动
问一个Java regexp的题JMS消息发布的问题
有什么办法高效的进行replaceAll有人用eclipse吗?
java 截取一部分string怎么用java作alert message啊?
我自己编了个Java面试题Which direction has the better future? Jobwise?
相关话题的讨论汇总
话题: string话题: replaceall话题: t1话题: wrong话题: text
进入Java版参与讨论
1 (共1页)
l********r
发帖数: 140
1
But you are wrong. The regular expression has a number of predefined
string/chars that you can NOT use.
Take a simple example:
String t1="FREE Tech Newsletters, Instant Messaging Planet Text, ");
t1=t1.toLowerCase();
String t2=t1.replaceAll(", .", ". ");
System.out.println(t2);
this will result in:
FREE Tech Newsletters. nstant Messaging Planet Text.
(the correct results one would expect --- if according to what you said,
should be the same string as t1.)
The problem is: we want to replace a sub
1 (共1页)
进入Java版参与讨论
相关主题
Which direction has the better future? Jobwise?问一个Java regexp的题
Lots of Java Positions at Red Hat有什么办法高效的进行replaceAll
How can I alert a spring message?java 截取一部分string
how to sent progress message back from a servlet to a client?我自己编了个Java面试题
Re: wrong!!! Re: 有没有 replaceall for Strijava str.replaceAll("\n", "") doesn't work
有没有 replaceall for String?如何确保每次读入的字符串都是unique的
why doesn't replaceAll work?Help me: jsp tag 问题
问个String:replaceALL的问题Re: JTextArea的内容不滚动
相关话题的讨论汇总
话题: string话题: replaceall话题: t1话题: wrong话题: text