/*
 * Copyright 2015 www.seleniumtests.com
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.seleniumtests.xmldog;

/**
 * StringUtil.java. To change this generated comment edit the template variable "typecomment":
 * Window>Preferences>Java>Templates. To enable and disable the creation of type comments go to
 * Window>Preferences>Java>Code Generation. $Id$
 */

/**
 * StringUtil class containing utility functions related to Strings.
 */

public class StringUtil {

    /**
     * Checks if the input String is Whitespace only.
     */

    public static boolean isWhitespaceStr(String str) {

        if (str == null) {

            return false;
        }

        str = str.trim();

        for (int i = 0; i < str.length(); i++) {

            if (!Character.isWhitespace(str.charAt(i))) {

                return false;
            }

        }

        return true;

    }

    /**
     * Gets Platform independent line separator (new line character(s).
     */

    public static String getNewlineStr() {

        return System.getProperty("line.separator");

    }

    /**
     * Main method for debugging purpose only.
     */

    public static void main(final String[] args) {

        /*
         *
         * NULL value checking for instanceof operator
         *
         */

        /*
         *
         * StringUtil su = null;
         *
         * if (su instanceof StringUtil)
         *
         *  System.out.println(" null can be instance of anything");
         *
         * else
         *
         *  System.out.println(" null cannot be instance of anything");
         *
         */

    }

}

@@ -625,333 +625,30 @@
 g;%0A%0A
-/**%0A * StringUtil.java. To change this generated comment edit the template variable %22typecomment%22:%0A * Window%3EPreferences%3EJava%3ETemplates. To enable and disable the creation of type comments go to%0A * Window%3EPreferences%3EJava%3ECode Generation. $Id$%0A */%0A%0A/**%0A * StringUtil class containing utility functions related to Strings.%0A */
+import java.util.UUID;
 %0A%0Apu
@@ -1288,338 +1288,98 @@
     
-/**%0A     * Main method for debugging purpose only.%0A     */%0A%0A    public static void main(final String%5B%5D args) %7B%0A%0A        /*%0A         *%0A         * NULL value checking for instanceof operator%0A         *%0A         */%0A%0A        /*%0A         *%0A         * StringUtil su = null;%0A         *%0A 
+public static String generateRandomString(boolean... split) %7B%0A
        
- *
  if
- 
 (s
-u instanceof StringUtil)%0A         *
+plit.length%3E0) %7B
 %0A   
@@ -1388,175 +1388,125 @@
     
-*
   
-System.out.println(%22 null can be instance of anything%22);%0A         *%0A         * else%0A         *%0A         *  System.out.println(%22 null cannot be instance of anything%22
+ return UUID.randomUUID().toString().split(%22-%22)%5B0%5D;%0A        %7D else %7B%0A            return UUID.randomUUID().toString(
 );%0A 
@@ -1516,29 +1516,14 @@
     
- *%0A         */%0A
+%7D
 %0A    %7D%0A
-%0A
 %7D%0A

add API to generate random string