• Post Reply Bookmark Topic Watch Topic
  • New Topic

removeAll \\u0000  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can not remove an ascii "null" from a string using \u0000 or ASCII 0 using myString.replaceAll(realEx, realEx1).
I have tried several variation of a real expression using every option that was listed on javadoc for 1.4.1.
Code not actual code but close)
String sData = String.valueOf( ((char)0) ) ;
sData = sData.replaceAll("\\u0000", "NulllluN" ) ;
Any correct answers gets today's gold star.
 
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!
You win the gold star, my friend, because your code works fine for me:

J2SDK 1.4.2 on Linux.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!