本文整理了Java中org.apache.commons.text.StringEscapeUtils.unescapeCsv()
方法的一些代码示例,展示了StringEscapeUtils.unescapeCsv()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StringEscapeUtils.unescapeCsv()
方法的具体详情如下:
包路径:org.apache.commons.text.StringEscapeUtils
类名称:StringEscapeUtils
方法名:unescapeCsv
暂无
代码示例来源:origin: apache/nifi
private LinkedHashSet<String> attributeListStringToSet(String attributeList) {
//take the user specified attribute list string and convert to list of strings.
LinkedHashSet<String> result = new LinkedHashSet<>();
if (StringUtils.isNotBlank(attributeList)) {
String[] ats = attributeList.split(SPLIT_REGEX);
for (String str : ats) {
result.add(StringEscapeUtils.unescapeCsv(str.trim()));
}
}
return result;
}
代码示例来源:origin: org.apache.commons/commons-text
@Test
public void testUnescapeCsvString() {
assertEquals("foo.bar", StringEscapeUtils.unescapeCsv("foo.bar"));
assertEquals("foo,bar", StringEscapeUtils.unescapeCsv("\"foo,bar\""));
assertEquals("foo\nbar", StringEscapeUtils.unescapeCsv("\"foo\nbar\""));
assertEquals("foo\rbar", StringEscapeUtils.unescapeCsv("\"foo\rbar\""));
assertEquals("foo\"bar", StringEscapeUtils.unescapeCsv("\"foo\"\"bar\""));
assertEquals("foo\uD84C\uDFB4bar", StringEscapeUtils.unescapeCsv("foo\uD84C\uDFB4bar"));
assertEquals("", StringEscapeUtils.unescapeCsv(""));
assertNull(StringEscapeUtils.unescapeCsv(null));
assertEquals("\"foo.bar\"", StringEscapeUtils.unescapeCsv("\"foo.bar\""));
}
代码示例来源:origin: org.apache.nifi/nifi-standard-processors
private LinkedHashSet<String> attributeListStringToSet(String attributeList) {
//take the user specified attribute list string and convert to list of strings.
LinkedHashSet<String> result = new LinkedHashSet<>();
if (StringUtils.isNotBlank(attributeList)) {
String[] ats = attributeList.split(SPLIT_REGEX);
for (String str : ats) {
result.add(StringEscapeUtils.unescapeCsv(str.trim()));
}
}
return result;
}
内容来源于网络,如有侵权,请联系作者删除!