Master:
# 1    I had a strange experience for java string replace                  
hans
Online no
State
Grouping Member
Class class4
Score 221
Wealth 155.5
Posts 156
Login 21:17:46
String str = str.replaceAll("\\n","<br />"); does not work.
so i have to use String str = str.replace("\\n","<br />");

it is surprised.
Hits: 341, Date: 2010-04-03 09:24:30
[Agree] ( 13 ) [Against] ( 13 )

# 2    replace() is not just replace char now, can replace a string                  
luke1
Online no
State 453
Grouping Super Admin
Class class4
Score 250
Wealth 62
Posts 230
Login 07:37:57
I remember, originally, it can only replace a char.

replaceAll() is suitable for writing a regular express pattern.
Hits: 328, Date: 2010-05-10 04:33:09
[Agree] ( 13 ) [Against] ( 11 )

1 - 2 [ 2]

Reply: I had a strange experience for java string replace

*First line:


More content:


Tags:



Hint: You cannot post here before loginLogin | Register

nothing