List of utility methods to do String Translate
String | translate(String input, String xmlName) translate if (xmlName.startsWith("B")) { if (input.equalsIgnoreCase("yes")) { return "true"; } else if (input.equalsIgnoreCase("no")) return "false"; } else if (xmlName.startsWith("Sel")) { if (input.equalsIgnoreCase("yes")) { return "Present"; ... |
String | translate(String message, String charsToBeReplaced, String replacementChars) translate method replaces a sequence of characters in a string with another set of characters. if (message == null) return message; boolean useEmpty = false; if (replacementChars == null || "".equals(replacementChars)) useEmpty = true; if (!useEmpty && (replacementChars.length() != charsToBeReplaced.length())) throw new IllegalArgumentException( "The replacement characters are not of the same length of the replaced characters."); ... |
String | translate(String name, int type) translate if (type == 0) { name = name.substring(1, name.length() - 1); name = name.replace('/', '.'); return name; } else { name = name.replace('.', '/'); name = "/" + name + "/"; return name; ... |
String | translate(String originalHtml) translate String html = originalHtml; while (true) { int end; int start = html.indexOf("<br/>* "); int offset = 7; if (start < 0) { start = html.indexOf("\n* "); offset = 3; ... |
char | translate(String s) translate switch (s) { case "&": return '&'; case "<": case "≪": return '<'; case ">": case "≫": ... |
char | translate(String s) translate if (s.equals("&")) { return '&'; } else if (s.equals("<") || s.equals("≪")) { return '<'; } else if (s.equals(">") || s.equals("≫")) { return '>'; } else if (s.equals(""")) { return '\"'; ... |
String | translate(String s, String identifier, String associator) Performs a character-for-character replacement within a string. String newString = ""; for (int index = 0; index < s.length(); index++) { String substring = s.substring(index, index + 1); int position = identifier.indexOf(substring); if (position != -1) newString = newString + associator.substring(position, position + 1); else newString = newString + s.substring(index, index + 1); ... |
String | translate(String s, String oldChars, String newChars) Translate characters from the String inStr found in the String oldChars to the corresponding character found in newChars. if (s == null || s.length() == 0) return s; StringBuffer outBuf = new StringBuffer(s.length()); int idx = -1; int limit = s.length(); for (int i = 0; i < limit; ++i) { char c = s.charAt(i); if ((idx = oldChars.indexOf(c)) != -1) { ... |
Object | translate(String sequence, String match, String replacement) This method is used to translate characters in the input sequence that match the characters in the match list to the corresponding character in the replacement list. if (sequence == null) { return sequence; StringBuffer buffer = new StringBuffer(sequence); for (int index = 0; index < buffer.length(); index++) { char ch = buffer.charAt(index); int position = match.indexOf(ch); if (position == -1) { ... |
String | translate(String source) translate String target = source; return target.replace("<", "<").replace(">", ">"); |