Top Description Fields Constructors Methods
com.ziclix.python.sql.pipe.csv

public Class CSVString

extends Object
Class Inheritance

A utility class to aide in quoting CSV strings.
Author
brian zimmer

Field Summary

Modifier and TypeField and Description
public static final String
DELIMITER

The default delimiter.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

a string derived from this string by replacing the first occurrence, or every occurrence, of search with replace.
replace
(String original, String
the old string
search
,
String
the new string
replace
,
boolean
if true all occurrences of the search string are replaced; if false only the first occurrence
all
)

Returns a new string resulting from replacing the first occurrence, or all occurrences, of search string in this string with replace string.

public static String

Returns:

a string derived from this string by replacing every occurrence of search with replace.
replace
(String original, String
the old string
search
,
String
the new string
replace
)

Returns a new string resulting from replacing all occurrences, of search string in this string with replace string.

public static String

Returns:

a string derived from this string by replacing the end oldSuffix by newSuffix
replaceEndWith
(String original, String
the old suffix
oldSuffix
,
String
the new suffix
newSuffix
)

Returns a new string resulting from replacing the end of this String from oldSuffix to newSuffix.

public static String
toCSV(String string)

Escape the string as needed using the default delimiter.

public static String
toCSV(String string, String delimiter)

Escape the string as needed using the given delimiter.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DELIMITERback to summary
public static final String DELIMITER

The default delimiter.

Constructor Detail

CSVStringback to summary
private CSVString()

Method Detail

replaceback to summary
public static String replace(String original, String search, 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:String

the old string

replace:String

the new string

all:boolean

if true all occurrences of the search string are replaced; if false only the first occurrence

Returns:String

a string derived from this string by replacing the first occurrence, or every occurrence, of search with replace.

replaceback to summary
public static String replace(String original, String search, 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:String

the old string

replace:String

the new string

Returns:String

a string derived from this string by replacing every occurrence of search with replace.

replaceEndWithback to summary
public static String replaceEndWith(String original, String oldSuffix, 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:String

the old suffix

newSuffix:String

the new suffix

Returns:String

a string derived from this string by replacing the end oldSuffix by newSuffix

toCSVback to summary
public static String toCSV(String string)

Escape the string as needed using the default delimiter.

toCSVback to summary
public static String toCSV(String string, String delimiter)

Escape the string as needed using the given delimiter.