Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Replacing sections of strings.
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Martin




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Sat Sep 25, 2004 5:50 pm   Post subject: (No subject)

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




PostPosted: Mon Sep 27, 2004 7:37 pm   Post subject: (No 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
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: