Parsing a part of a string of unknown length

// I read each char in and if it equal \n then I know its the end of line.
if (myChar == '\n') {
               int     colonPosition;  // the position of the next comma in the string
          colonPosition = currentLine.indexOf(':');
          Title =currentLine.substring(colonPosition+1, currentLine.length());
          
}