good code to study – common.apache.org.StringUtils

http://commons.apache.org/lang/api-2.5/org/apache/commons/lang/StringUtils.html#replaceEach%28java.lang.String,%20java.lang.String%5B%5D,%20java.lang.String%5B%5D%29

 

my code:

 

String[] searchList = new String[]
    {
            "/", "\\", ".", "!", ";", "," //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$//$NON-NLS-5$//$NON-NLS-6$
    };
    String[] replacer = new String[searchList.length];
    Arrays.fill( replacer, "_" ); //$NON-NLS-1$
    resultSetName = StringUtils.replaceEach( resultSetName, searchList, replacer );

Advertisements
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s