Monday, March 29, 2010

Substring on a huge string

The garbage collector won't be able to clean up the underlying byte array.
public static String getIntro()
{
    String novel = novelFactory.writeNovel();
    return novel.substring(0, 140);
}

No comments:

Post a Comment