com.ziclix.python.sql.pipe.csv
Class CSVString
- java.lang.Object
-
- com.ziclix.python.sql.pipe.csv.CSVString
-
public class CSVString extends java.lang.ObjectA utility class to aide in quoting CSV strings.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringDELIMITERThe default delimiter.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.lang.Stringreplace(java.lang.String original, java.lang.String search, java.lang.String replace)Returns a new string resulting from replacing all occurrences, of search string in this string with replace string.static java.lang.Stringreplace(java.lang.String original, java.lang.String search, java.lang.String replace, boolean all)Returns a new string resulting from replacing the first occurrence, or all occurrences, of search string in this string with replace string.static java.lang.StringreplaceEndWith(java.lang.String original, java.lang.String oldSuffix, java.lang.String newSuffix)Returns a new string resulting from replacing the end of this String from oldSuffix to newSuffix.static java.lang.StringtoCSV(java.lang.String string)Escape the string as needed using the default delimiter.static java.lang.StringtoCSV(java.lang.String string, java.lang.String delimiter)Escape the string as needed using the given delimiter.
-
-
-
Field Detail
-
DELIMITER
public static final java.lang.String DELIMITER
The default delimiter.- See Also:
- Constant Field Values
-
-
Method Detail
-
toCSV
public static java.lang.String toCSV(java.lang.String string)
Escape the string as needed using the default delimiter.
-
toCSV
public static java.lang.String toCSV(java.lang.String string, java.lang.String delimiter)Escape the string as needed using the given delimiter.
-
replace
public static java.lang.String replace(java.lang.String original, java.lang.String search, java.lang.String replace, boolean all)Returns a new string resulting from replacing the first occurrence, or all occurrences, of search string in this string with replace string. If the string search does not occur in the character sequence represented by this object, then this string is returned.- Parameters:
search- the old stringreplace- the new stringall- iftrueall occurrences of the search string are replaced; iffalseonly the first occurrence- Returns:
- a string derived from this string by replacing the first occurrence, or every
occurrence, of
searchwithreplace.
-
replace
public static java.lang.String replace(java.lang.String original, java.lang.String search, java.lang.String replace)Returns a new string resulting from replacing all occurrences, of search string in this string with replace string. If the string search does not occur in the character sequence represented by this object, then this string is returned.- Parameters:
search- the old stringreplace- the new string- Returns:
- a string derived from this string by replacing every occurrence of search with replace.
-
replaceEndWith
public static java.lang.String replaceEndWith(java.lang.String original, java.lang.String oldSuffix, java.lang.String newSuffix)Returns a new string resulting from replacing the end of this String from oldSuffix to newSuffix. The original string is returned if it does not end with oldSuffix.- Parameters:
oldSuffix- the old suffixnewSuffix- the new suffix- Returns:
- a string derived from this string by replacing the end oldSuffix by newSuffix
-
-
DataMelt 3.0 © DataMelt by jWork.ORG