if (res.length() != 0)
if (str.length() != 0)
    private String stripInternalSpaces(        String str)    {        StringBuffer res = new StringBuffer();        if (res.length() != 0)        {            char    c1 = str.charAt(0);            res.append(c1);            for (int k = 1; k < str.length(); k++)            {                char    c2 = str.charAt(k);                if (!(c1 == ' ' && c2 == ' '))                {                    res.append(c2);                }                c1 = c2;            }        }        return res.toString();    }