public String[] addToStringArray(String[] strArray, String str) {
        String[] result = null;
        if (strArray != null) {
            result = new String[strArray.length + 1];
            System.arraycopy(strArray, 0, result, 0, strArray.length);
            result[strArray.length] = str;
        }
        return result;
    }
public String [ ] addToStringArray ( String [ ] strArray , String str ) { String [ ] result = null ; if ( strArray != null ) { result = new String [ strArray . length + 1 ] ; System . arraycopy ( strArray , 0 , result , 0 , strArray . length ) ; result [ strArray . length ] = str ; } return result ; }
Add the given string to the string array. This will create a new array
expanded by one element, copy the existing array, add the given value,
and return the resulting array.

@param strArray The array of strings to add to
@param str The string to add

@return A new array containing the string array and the given string