public static String cleanString(String in)
    {
        int commentBeginIndex, commentEndIndex;
        String out = in;
        
        while ((commentBeginIndex = out.indexOf("/*")) > -1)
        {
            if ((commentEndIndex = out.indexOf("*/", commentBeginIndex)) > -1)
            {
                out = out.substring(0, commentBeginIndex) + out.substring(commentEndIndex + 2);
            }
            else
            {
                out = out.substring(0, commentBeginIndex);
            }
        }
        
        while ((commentBeginIndex = out.indexOf("//")) > -1)
        {
            if ((commentEndIndex = out.indexOf("\n", commentBeginIndex)) > -1)
            {
                out = out.substring(0, commentBeginIndex) + out.substring(commentEndIndex);
            }
            else
            {
                out = out.substring(0, commentBeginIndex);
            }
        }
        
        return out;
    }