[RESOLVED] String Replace...
can somebody tell me what the error in this code is please?
Code:
// NOTE:
// client.sSpaceRep = "%20";
public String EncodeChatMsg(String ChatMsgIn){
String sReplace;
// Start the process of editing the message
sReplace = ChatMsgIn;
// Find any double spaces
while(sReplace.indexOf(" ") != -1){
// change the double to single space
sReplace.Replace(" "," ");
}
// replace single spaces with %20
sReplace.Replace(" ",client.sSpaceRep);
// Return the edited msg
return sReplace;
}
Code:
C:\Programming\TheWalks\TheWalksChat\JavaChat\chatclient\ClientInterface.java:253: cannot resolve symbol
symbol : method Replace (java.lang.String,java.lang.String)
location: class java.lang.String
sReplace.Replace(" "," ");
^
C:\Programming\TheWalks\TheWalksChat\JavaChat\chatclient\ClientInterface.java:255: cannot resolve symbol
symbol : method Replace (java.lang.String,java.lang.String)
location: class java.lang.String
sReplace.Replace(" ",client.sSpaceRep);
^