Class StringTokenizerWithEscape


  • public class StringTokenizerWithEscape
    extends java.lang.Object
    Works like StringTokenizer but with support for an escape character. The escape character applies to the delimiter and itself. There are however some differences - see nextToken().
    Since:
    MicroStrategy Web 9.0.1
    • Constructor Summary

      Constructors 
      Constructor Description
      StringTokenizerWithEscape​(java.lang.String str, char delim, char esc)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasMoreTokens()  
      java.lang.String nextToken()  
      java.lang.String nextToken​(boolean escapeResults)
      Unlike StringTokenizer this class will return an empty string if there are consecutive delimiters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringTokenizerWithEscape

        public StringTokenizerWithEscape​(java.lang.String str,
                                         char delim,
                                         char esc)
    • Method Detail

      • hasMoreTokens

        public boolean hasMoreTokens()
      • nextToken

        public java.lang.String nextToken()
        Returns:
        nextToken(boolean) with 'escapeResults' set to true
      • nextToken

        public java.lang.String nextToken​(boolean escapeResults)
        Unlike StringTokenizer this class will return an empty string if there are consecutive delimiters. Returns null if no more tokens exist.
        Parameters:
        escapeResults - whether to escape results, i.e. if true, will strip out the escape character when it precedes a delimters/escape character.