Package org.gvsig.catalog.utils
Class Strings
java.lang.Object
org.gvsig.catalog.utils.Strings
String Functions
- Author:
- Jorge Piera Llodra (piera_jor@gva.es)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddAsteriscsFromAnArray(String array) This method creates an String of words (blanck separated) enveloped by asteriscs: Example "This is an example" returns "*This* *is* *an* *example*"static VectorallWordForms(String str, boolean withAccents) This method returns all the forms than can have a word to do an advanced search.static booleanFind a pattern into one arraystatic StringgetBlankSeparated(String[] input) returns a list (blanck-separated) in one unique stringstatic StringgetComaSeparated(String[] input) returns a list (comma-separated) in one unique stringstatic StringgetUperCaseFirst(String str) It returns an string with the firs chacarter in UperCasestatic String[]This function joins two stringsstatic StringremoveAccents(String str) This method remove all the string accentsstatic StringReplace a part of a Stringstatic TreeMapseparateParams(String pairValues) Creates a TreeMap froma KVPstatic StringtryIfIsNumber(String str, int charNumber) This function is used to try if a string is a number.
-
Constructor Details
-
Strings
public Strings()
-
-
Method Details
-
replace
Replace a part of a String- Parameters:
str- String to find the patternpattern- Pattern to findreplace- String to replace- Returns:
-
find
Find a pattern into one array- Parameters:
pattern-array-- Returns:
-
join
This function joins two strings- Parameters:
s1-s2-- Returns:
-
getComaSeparated
returns a list (comma-separated) in one unique string- Parameters:
input-- Returns:
-
getBlankSeparated
returns a list (blanck-separated) in one unique string- Parameters:
input-- Returns:
-
addAsteriscsFromAnArray
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
This function is used to try if a string is a number.- Parameters:
str- Input StringcharNumber- Number of chars that must be tried- Returns:
- The numbers of the String
-
removeAccents
This method remove all the string accents- Parameters:
str- Input String- Returns:
- String withOut accents
-
allWordForms
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
It returns an string with the firs chacarter in UperCase- Parameters:
str- Input str- Returns:
-
separateParams
Creates a TreeMap froma KVP- Parameters:
pairValues- KVP string- Returns:
- TreeMap
-