Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jre doubt

 
ranga shreya
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have used string.replaceAll() in rad.
when I am trying to put that code in wsad5.1.0 it's showing error in the place where I have used string.replaceAll() .
What might be the reason for this.
Please give me the reply
thanks,
Ranga
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
replaceAll was new in 1.4. Any chance you're running an older JVM in WSAD? I am.
 
ranga shreya
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes I am running in jdk1.3 wsad 5.1.0..
So what is the solution for this.
Please reply asap
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15272
37
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Upgrade to a newer Java version if possible, or use some other methods instead of replaceAll() to do what you want.

If you need regular expressions while working with JDK 1.3, have a look at Apache Jakarta Regexp or Apache Jakarta ORO.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Java in General (Beginner).
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On my very first Java project I wrote my own replaceAll that uses indexOf and substrings and loops until the old value is no longer found. It's slightly tricky to keep track of starting position when searcing for the old value, cause the first version of "replace A with AB" looped forever.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic