Class Strings

java.lang.Object
org.gvsig.catalog.utils.Strings

public class Strings extends Object
String Functions
Author:
Jorge Piera Llodra (piera_jor@gva.es)
  • Constructor Details

    • Strings

      public Strings()
  • Method Details

    • replace

      public static String replace(String str, String pattern, String replace)
      Replace a part of a String
      Parameters:
      str - String to find the pattern
      pattern - Pattern to find
      replace - String to replace
      Returns:
    • find

      public static boolean find(String pattern, String[] array)
      Find a pattern into one array
      Parameters:
      pattern -
      array -
      Returns:
    • join

      public static String[] join(String[] s1, String[] s2)
      This function joins two strings
      Parameters:
      s1 -
      s2 -
      Returns:
    • getComaSeparated

      public static String getComaSeparated(String[] input)
      returns a list (comma-separated) in one unique string
      Parameters:
      input -
      Returns:
    • getBlankSeparated

      public static String getBlankSeparated(String[] input)
      returns a list (blanck-separated) in one unique string
      Parameters:
      input -
      Returns:
    • addAsteriscsFromAnArray

      public static String addAsteriscsFromAnArray(String array)
      This method creates an String of words (blanck separated) enveloped by asteriscs: Example "This is an example" returns "*This* *is* *an* *example*"
      Parameters:
      array - Input String
      Returns:
      String
    • tryIfIsNumber

      public static String tryIfIsNumber(String str, int charNumber)
      This function is used to try if a string is a number.
      Parameters:
      str - Input String
      charNumber - Number of chars that must be tried
      Returns:
      The numbers of the String
    • removeAccents

      public static String removeAccents(String str)
      This method remove all the string accents
      Parameters:
      str - Input String
      Returns:
      String withOut accents
    • allWordForms

      public static Vector allWordForms(String str, boolean withAccents)
      This method returns all the forms than can have a word to do an advanced search. A form could be to change all the characters to lower case, other one could be to change only the first character to upper case, ...
      Parameters:
      str - Input string
      Returns:
      A vector of strings
    • getUperCaseFirst

      public static String getUperCaseFirst(String str)
      It returns an string with the firs chacarter in UperCase
      Parameters:
      str - Input str
      Returns:
    • separateParams

      public static TreeMap separateParams(String pairValues)
      Creates a TreeMap froma KVP
      Parameters:
      pairValues - KVP string
      Returns:
      TreeMap