내가 문자열에 문제가있어에 문자열로 교체하고 나는 예를 들어, 같은 위치에서 발견 나는 문자로 특정 위치에서 찾을 문자를 대체하기 위해 노력하고있어 솔루션이 필요자바 문자열 같은 위치
private String wordNormalize(String enteredWord,String dictionary){
String normalizedWord = null;
// remove empty spaces at beginning and at the end of the word and change to lower case
normalizedWord = enteredWord.trim().toLowerCase();
//normalize term, removing all punctuation marks
normalizedWord = normalizedWord.replaceAll("["+punctuationMarks2+"]", "[b,v]");
//normalize word removing to character if dictionary has english lang
normalizedWord = normalizedWord.replaceFirst("to ", " ");
//normalizeWord if dictionary has german
if(normalizedWord.length() > 0){
normalizedWord.replace("a,b,c","t,u,v");
/*for(int i = 0;i<normalizedWord.length();i++){
char currentChar = normalizedWord.charAt(i); // currently typed character
String s1= Character.toString(currentChar);
for(int j = 0;j<specialCharacters.length;j++){
s1.replaceAll("[ "+specialCharacters[i]+" ]",""+replaceCharactersDe[i]+"");
}
= str.replace("a,b,c","t,u,v");
}*/
}
//normalize term removing special characters and replacing them
/*for(int i = 0; i > specialCharacters.length;i++){
if(normalizedWord.equals(specialCharacters[i])){
normalizedWord = replaceCharactersDe[i];
}
}*/
return normalizedWord;
}
그래서 사용자가 t로 대체 된 문자를 입력하고 사용자가 b를 입력하면 그 문자가 u로 대체되고 사용자가 c로 입력하면 c가이 문자로 교체되며이 순서 대로만 가능합니다. 옳은 길 그 일을해야한다고
[String.replace (char, char)] (http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#replace%28char,%20char%29) – nhahtdh
'오직 그 순서대로 '란 무엇을 의미합니까? –