User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » java help Page [1]  
Genki
All American
590 Posts
user info
edit post

I'm trying to strip the R's from this statement (SHRI R1 R1 1) so it'll appear as SHRI 1 1 1. But the R in SHRI keeps getting stripped. I'm using String delim = "[ R]+" and its not working. Anybody?

11/13/2009 10:00:30 PM

scrager
All American
9481 Posts
user info
edit post

myString.replaceAll("R(\d)", "$1")

or

myString.replaceAll("R([^I])", "$1")

depends on how different your real world solution is for your example.

[Edited on November 13, 2009 at 10:08 PM. Reason : .]

11/13/2009 10:06:25 PM

Genki
All American
590 Posts
user info
edit post

anyway I can use the split method?

11/13/2009 10:31:20 PM

roadkill
Veteran
142 Posts
user info
edit post

maybe delim = "[\\s+R+]"

11/14/2009 12:31:45 AM

 Message Boards » Tech Talk » java help Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.