org.apache.wicket.util.string.Strings.beforeLast()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(91)

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

Strings.beforeLast介绍

[英]Returns everything before the last occurrence of the given character in s.
[中]

代码示例

代码示例来源:origin: org.apache.wicket/wicket-util

/**
 * Gets everything before the last path component of a path using a given separator. If the
 * separator cannot be found, the path itself is returned.
 * <p>
 * For example, beforeLastPathComponent("foo.bar.baz", '.') would return "foo.bar" and
 * beforeLastPathComponent("foo", '.') would return "".
 * 
 * @param path
 *            The path to parse
 * @param separator
 *            The path separator character
 * @return Everything before the last component in the path
 */
public static String beforeLastPathComponent(final String path, final char separator)
{
  return beforeLast(path, separator);
}

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

/**
 * Gets everything before the last path component of a path using a given separator. If the
 * separator cannot be found, the path itself is returned.
 * <p>
 * For example, beforeLastPathComponent("foo.bar.baz", '.') would return "foo.bar" and
 * beforeLastPathComponent("foo", '.') would return "".
 * 
 * @param path
 *            The path to parse
 * @param separator
 *            The path separator character
 * @return Everything before the last component in the path
 */
public static String beforeLastPathComponent(final String path, final char separator)
{
  return beforeLast(path, separator);
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Gets everything before the last path component of a path using a given separator. If the
 * separator cannot be found, the path itself is returned.
 * <p>
 * For example, beforeLastPathComponent("foo.bar.baz", '.') would return "foo.bar" and
 * beforeLastPathComponent("foo", '.') would return "".
 * 
 * @param path
 *            The path to parse
 * @param separator
 *            The path separator character
 * @return Everything before the last component in the path
 */
public static String beforeLastPathComponent(final String path, final char separator)
{
  return beforeLast(path, separator);
}

代码示例来源:origin: theonedev/onedev

/**
 * Gets everything before the last path component of a path using a given separator. If the
 * separator cannot be found, the path itself is returned.
 * <p>
 * For example, beforeLastPathComponent("foo.bar.baz", '.') would return "foo.bar" and
 * beforeLastPathComponent("foo", '.') would return "".
 * 
 * @param path
 *            The path to parse
 * @param separator
 *            The path separator character
 * @return Everything before the last component in the path
 */
public static String beforeLastPathComponent(final String path, final char separator)
{
  return beforeLast(path, separator);
}

代码示例来源:origin: org.apache.wicket/wicket-core

this.path = Strings.beforeLast(path, '.');

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

private ResourceNameIterator newResourceNameIterator(String path, String style, Locale locale,
  String extension)
{
  final String realPath;
  final String realExtension;
  if ((extension == null) && (path != null) && (path.indexOf('.') != -1))
  {
    realPath = Strings.beforeLast(path, '.');
    // for extensions with separator take the first extension
    realExtension = Strings.afterLast(path, '.');
    if (realExtension.indexOf(',') > -1)
    {
      // multiple extensions are not allowed in the path parameter
      return new EmptyResourceNameIterator();
    }
  }
  else
  {
    realPath = path;
    realExtension = extension;
  }
  return new ResourceNameIterator(realPath, style, locale, realExtension);
}

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

/**
 * Construct.
 * 
 * @param path
 *            The path of the resource without extension
 * @param style
 *            A theme or style (see {@link org.apache.wicket.Session})
 * @param locale
 *            The Locale to apply
 * @param extensions
 *            the filname's extensions (comma separated)
 */
public ResourceNameIterator(String path, final String style, final Locale locale,
    final String extensions)
{
  this.locale = locale;
  if (extensions == null)
  {
    this.extensions = Strings.afterLast(path, '.');
    path = Strings.beforeLast(path, '.');
  }
  else
  {
    this.extensions = extensions;
  }
  this.styleIterator = new StyleAndVariationResourceNameIterator(path, style, null);
}

代码示例来源:origin: apache/wicket

this.path = Strings.beforeLast(path, '.');

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

path = Strings.beforeLast(path, '.');

代码示例来源:origin: apache/wicket

packageName = Strings.beforeLast(packageName, '/');

代码示例来源:origin: org.apache.wicket/wicket-core

packageName = Strings.beforeLast(packageName, '/');

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

packageName = Strings.beforeLast(packageName, '/');

代码示例来源:origin: org.apache.wicket/wicket-core

realPath = Strings.beforeLast(path, '.');
String realExtension = Strings.afterLast(path, '.');
if (realExtension.indexOf(',') > -1)

代码示例来源:origin: apache/wicket

realPath = Strings.beforeLast(path, '.');
String realExtension = Strings.afterLast(path, '.');
if (realExtension.indexOf(',') > -1)

相关文章