Skip to content

StringIndexOutOfBounds in joinWithString #7

@GoogleCodeExporter

Description

@GoogleCodeExporter
This function throws a StringIndexOutOfBounds if the words collection is 
empty ...

class SimpleNamingContext ... {
...

     public static String joinWithString(String seperator, Collection<?> 
words) {
         String ret = "";
         for (Object s: words) {
             ret+=s.toString()+seperator;
         }
         return ret.substring(0, ret.length()-seperator.length());
     }

Original issue reported on code.google.com by dob...@gmail.com on 11 Sep 2009 at 5:16

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions