Tabnine Logo
StringUtils.countSlashes
Code IndexAdd Tabnine to your IDE (free)

How to use
countSlashes
method
in
com.ocpsoft.pretty.faces.util.StringUtils

Best Java code snippets using com.ocpsoft.pretty.faces.util.StringUtils.countSlashes (Showing top 4 results out of 315)

origin: ocpsoft/rewrite

public static String[] splitBySlash(final String s)
{
 if (s == null || isBlank(s))
 {
   return new String[0];
 }
 char[] chars = s.toCharArray();
 int numberOfSegments = countSlashes(s) + 1;
 final String[] segments = new String[numberOfSegments];
 int currentSegmentIndex = 0;
 int lastSlashIndex = -1;
 for (int i = 0; i < chars.length; ++i)
 {
   if (chars[i] == '/')
   {
    segments[currentSegmentIndex] = new String(chars, lastSlashIndex + 1, i - lastSlashIndex - 1);
    ++currentSegmentIndex;
    lastSlashIndex = i;
   }
 }
 if (lastSlashIndex + 1 < chars.length)
 {
   segments[currentSegmentIndex] = new String(chars, lastSlashIndex + 1, chars.length - lastSlashIndex - 1);
 }
 else
 {
   segments[currentSegmentIndex] = "";
 }
 return segments;
}
origin: ocpsoft/prettyfaces

public static String[] splitBySlash(final String s)
{
 if (s == null || isBlank(s))
 {
   return new String[0];
 }
 char[] chars = s.toCharArray();
 int numberOfSegments = countSlashes(s) + 1;
 final String[] segments = new String[numberOfSegments];
 int currentSegmentIndex = 0;
 int lastSlashIndex = -1;
 for (int i = 0; i < chars.length; ++i)
 {
   if (chars[i] == '/')
   {
    segments[currentSegmentIndex] = new String(chars, lastSlashIndex + 1, i - lastSlashIndex - 1);
    ++currentSegmentIndex;
    lastSlashIndex = i;
   }
 }
 if (lastSlashIndex + 1 < chars.length)
 {
   segments[currentSegmentIndex] = new String(chars, lastSlashIndex + 1, chars.length - lastSlashIndex - 1);
 }
 else
 {
   segments[currentSegmentIndex] = "";
 }
 return segments;
}
origin: ocpsoft/prettyfaces

public static String[] splitBySlash(final String s)
{
 if (s == null || isBlank(s))
 {
   return new String[0];
 }
 char[] chars = s.toCharArray();
 int numberOfSegments = countSlashes(s) + 1;
 final String[] segments = new String[numberOfSegments];
 int currentSegmentIndex = 0;
 int lastSlashIndex = -1;
 for (int i = 0; i < chars.length; ++i)
 {
   if (chars[i] == '/')
   {
    segments[currentSegmentIndex] = new String(chars, lastSlashIndex + 1, i - lastSlashIndex - 1);
    ++currentSegmentIndex;
    lastSlashIndex = i;
   }
 }
 if (lastSlashIndex + 1 < chars.length)
 {
   segments[currentSegmentIndex] = new String(chars, lastSlashIndex + 1, chars.length - lastSlashIndex - 1);
 }
 else
 {
   segments[currentSegmentIndex] = "";
 }
 return segments;
}
origin: com.ocpsoft/prettyfaces-jsf2

public static String[] splitBySlash(final String s)
{
 if (s == null || isBlank(s))
 {
   return new String[0];
 }
 char[] chars = s.toCharArray();
 int numberOfSegments = countSlashes(s) + 1;
 final String[] segments = new String[numberOfSegments];
 int currentSegmentIndex = 0;
 int lastSlashIndex = -1;
 for (int i = 0; i < chars.length; ++i)
 {
   if (chars[i] == '/')
   {
    segments[currentSegmentIndex] = new String(chars, lastSlashIndex + 1, i - lastSlashIndex - 1);
    ++currentSegmentIndex;
    lastSlashIndex = i;
   }
 }
 if (lastSlashIndex + 1 < chars.length)
 {
   segments[currentSegmentIndex] = new String(chars, lastSlashIndex + 1, chars.length - lastSlashIndex - 1);
 }
 else
 {
   segments[currentSegmentIndex] = "";
 }
 return segments;
}
com.ocpsoft.pretty.faces.utilStringUtilscountSlashes

Popular methods of StringUtils

  • hasLeadingSlash
  • hasTrailingSlash
  • isBlank
  • isNotBlank
  • splitBySlash

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • findViewById (Activity)
  • compareTo (BigDecimal)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • JComboBox (javax.swing)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now