lets say I have
import java.util.Scanner;
public class CharacterRemover{
public static void main(String[]args){
String word = "abcd+def";
//what do I do to remove e? or any of the variables or operand
}
}




Posted 31 August 2010 - 04:38 AM
import java.util.Scanner;
public class CharacterRemover{
public static void main(String[]args){
String word = "abcd+def";
//what do I do to remove e? or any of the variables or operand
}
}
Posted 31 August 2010 - 04:39 AM
public class CharacterRemover{
public static void main(String[]args){
String word = "abcd+def";
//what do I do to remove e? or any of the variables or operand
}
}
Stack s = new Stack();
Stack combine = new Stack();
s.push('a');
s.push('b');
//what will I do so the combine Stack will be updated like below
combine.push("ab")
s.pop();
//what will I do so the combine Stack will be updated like below
combine.push("a");
This post has been edited by kneil_20: 31 August 2010 - 05:00 AM
Posted 31 August 2010 - 05:06 AM
String word = "abcd+def";
public static String removeChar(String word, char e) {
String r = "";
for (int i = 0; i < word.length(); i ++) {
if (word.charAt(i) != e) r += word.charAt(i);
}
return r;
}
This post has been edited by Dean_Grobler: 31 August 2010 - 05:11 AM
Posted 31 August 2010 - 05:14 AM
Posted 31 August 2010 - 05:39 AM
This post has been edited by JackOfAllTrades: 31 August 2010 - 05:40 AM
Posted 31 August 2010 - 03:32 PM
s = s.replaceAll("e", "");
StringBuilder sb = new StringBuilder(s); sb = sb.deleteCharAt(place where e is); s = sb.toString();
|
|
Query failed: connection to localhost:3312 failed (errno=111, msg=Connection refused).
|
