Computer Science Canada

Replacing sections of strings.

Author:  Martin [ Sat Sep 25, 2004 3:53 pm ]
Post subject:  Replacing sections of strings.

Suppose I have a string:

String s = "abcdef123lmno";

And I want to replace the 123 with "ghijk".

How do I do this?

Merci.

Author:  wtd [ Sat Sep 25, 2004 5:50 pm ]
Post subject: 

[url]http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#replaceFirst(java.lang.String,%20java.lang.String)[/url]

Author:  zylum [ Mon Sep 27, 2004 7:37 pm ]
Post subject: 

speaking of regex, here are a few tables i made to make things a bit easier:

http://members.rogers.com/zylum/programming/resources/regex.htm


: