org.apache.commons.io.FilenameUtils.splitOnTokens()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(155)

本文整理了Java中org.apache.commons.io.FilenameUtils.splitOnTokens()方法的一些代码示例,展示了FilenameUtils.splitOnTokens()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FilenameUtils.splitOnTokens()方法的具体详情如下:
包路径:org.apache.commons.io.FilenameUtils
类名称:FilenameUtils
方法名:splitOnTokens

FilenameUtils.splitOnTokens介绍

[英]Splits a string into a number of tokens. The text is split by '?' and ''. Where multiple '' occur consecutively they are collapsed into a single ''.
[中]将字符串拆分为多个标记。文本被“?”分割和“
”。当多个“”连续出现时,它们被折叠成一个“”。

代码示例

代码示例来源:origin: commons-io/commons-io

@Test
public void testSplitOnTokens() {
  assertArrayEquals(new String[] { "Ad", "*", "er" }, FilenameUtils.splitOnTokens("Ad*er"));
  assertArrayEquals(new String[] { "Ad", "?", "er" }, FilenameUtils.splitOnTokens("Ad?er"));
  assertArrayEquals(new String[] { "Test", "*", "?", "One" }, FilenameUtils.splitOnTokens("Test*?One"));
  assertArrayEquals(new String[] { "Test", "?", "*", "One" }, FilenameUtils.splitOnTokens("Test?*One"));
  assertArrayEquals(new String[] { "*" }, FilenameUtils.splitOnTokens("****"));
  assertArrayEquals(new String[] { "*", "?", "?", "*" }, FilenameUtils.splitOnTokens("*??*"));
  assertArrayEquals(new String[] { "*", "?", "*", "?", "*" }, FilenameUtils.splitOnTokens("*?**?*"));
  assertArrayEquals(new String[] { "*", "?", "*", "?", "*" }, FilenameUtils.splitOnTokens("*?***?*"));
  assertArrayEquals(new String[] { "h", "?", "?", "*" }, FilenameUtils.splitOnTokens("h??*"));
  assertArrayEquals(new String[] { "" }, FilenameUtils.splitOnTokens(""));
}

代码示例来源:origin: commons-io/commons-io

caseSensitivity = IOCase.SENSITIVE;
final String[] wcs = splitOnTokens(wildcardMatcher);
boolean anyChars = false;
int textIdx = 0;

代码示例来源:origin: org.apache.commons/commons-io

String[] wcs = splitOnTokens(wildcardMatcher);
boolean anyChars = false;
int textIdx = 0;

代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.io

String[] wcs = splitOnTokens(wildcardMatcher);
boolean anyChars = false;
int textIdx = 0;

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-io

String[] wcs = splitOnTokens(wildcardMatcher);
boolean anyChars = false;
int textIdx = 0;

代码示例来源:origin: io.github.stephenc.docker/docker-client-shaded

caseSensitivity = IOCase.SENSITIVE;
final String[] wcs = splitOnTokens(wildcardMatcher);
boolean anyChars = false;
int textIdx = 0;

代码示例来源:origin: org.onosproject/onlab-thirdparty

caseSensitivity = IOCase.SENSITIVE;
String[] wcs = splitOnTokens(wildcardMatcher);
boolean anyChars = false;
int textIdx = 0;

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

caseSensitivity = IOCase.SENSITIVE;
final String[] wcs = splitOnTokens(wildcardMatcher);
boolean anyChars = false;
int textIdx = 0;

代码示例来源:origin: org.uberfire/vfs-model

caseSensitivity = IOCase.SENSITIVE;
String[] wcs = splitOnTokens(wildcardMatcher);
boolean anyChars = false;
int textIdx = 0;

代码示例来源:origin: org.kie.commons/kie-nio2-model

caseSensitivity = IOCase.SENSITIVE;
String[] wcs = splitOnTokens(wildcardMatcher);
boolean anyChars = false;
int textIdx = 0;

代码示例来源:origin: Nextdoor/bender

caseSensitivity = IOCase.SENSITIVE;
String[] wcs = splitOnTokens(wildcardMatcher);
boolean anyChars = false;
int textIdx = 0;

相关文章