本文整理了Java中weka.core.Utils.replaceStrings()
方法的一些代码示例,展示了Utils.replaceStrings()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.replaceStrings()
方法的具体详情如下:
包路径:weka.core.Utils
类名称:Utils
方法名:replaceStrings
[英]Converts the specified strings in the given string to the specified characters.
[中]将给定字符串中的指定字符串转换为指定字符。
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
/**
* The inverse operation of backQuoteChars(). Converts back-quoted carriage
* returns and new lines in a string to the corresponding character ('\r' and
* '\n'). Also "un"-back-quotes the following characters: ` " \ \t and %
*
* @param string the string
* @return the converted string
* @see #backQuoteChars(String)
*/
public static String unbackQuoteChars(String string) {
String charsFind[] = { "\\\\", "\\'", "\\t", "\\n", "\\r", "\\\"", "\\%", "\\u001E" };
char charsReplace[] = { '\\', '\'', '\t', '\n', '\r', '"', '%', '\u001E' };
return replaceStrings(string, charsFind, charsReplace);
}
代码示例来源:origin: Waikato/weka-trunk
/**
* The inverse operation of backQuoteChars(). Converts back-quoted carriage
* returns and new lines in a string to the corresponding character ('\r' and
* '\n'). Also "un"-back-quotes the following characters: ` " \ \t and %
*
* @param string the string
* @return the converted string
* @see #backQuoteChars(String)
*/
public static String unbackQuoteChars(String string) {
String charsFind[] = { "\\\\", "\\'", "\\t", "\\n", "\\r", "\\\"", "\\%", "\\u001E" };
char charsReplace[] = { '\\', '\'', '\t', '\n', '\r', '"', '%', '\u001E' };
return replaceStrings(string, charsFind, charsReplace);
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
optStr = replaceStrings(optStr, toReplace, replacements);
} else {
optStr = unbackQuoteChars(optStr);
代码示例来源:origin: Waikato/weka-trunk
optStr = replaceStrings(optStr, toReplace, replacements);
} else {
optStr = unbackQuoteChars(optStr);
内容来源于网络,如有侵权,请联系作者删除!