src/Foundation/Text/Gimela.Text/Readers/StringReader.cs
/// <summary>
/// Read to end of buffer, or until specified delimiter is found.
/// </summary>
/// <param name="delimiter">Delimiter to find.</param>
/// <returns>A string (can be <see cref="string.Empty"/>).</returns>
/// <exception cref="InvalidOperationException"><c>InvalidOperationException</c>.</exception>
Read to end of buffer, or until specified delimiter is found.
Read to end of buffer or until specified delimiter is found .
public string ReadToEnd(char delimiter)
    {
      if (EOF)
        return string.Empty;
      int startIndex = Index;
      while (true)
      {
        if (EOF)
          return GetString(startIndex, Index);
        if (Current == delimiter)
          return GetString(startIndex, Index, true);
        if (delimiter != '\r' && delimiter != '\n' && Current == '\r' || Current == '\n')
          throw new InvalidOperationException("Unexpected new line: " + GetString(startIndex, Index) +
                                              "[CRLF].");
        ++Index;
      }
    }
public string ReadToEnd ( char delimiter ) { if ( EOF ) return string . Empty ; int startIndex = Index ; while ( true ) { if ( EOF ) return GetString ( startIndex , Index ) ; if ( Current == delimiter ) return GetString ( startIndex , Index , true ) ; if ( delimiter != ' \r ' && delimiter != ' \n ' && Current == ' \r ' || Current == ' \n ' ) throw new InvalidOperationException ( " " + GetString ( startIndex , Index ) + " " ) ; ++ Index ; } }
Read to end of buffer, or until specified delimiter is found.
Read to end of buffer or until specified delimiter is found .
// Delimiter is not new line and we got one.
A string (can be ).
A string ( can be ) .
None
delimiter
char
Delimiter to find.
Delimiter to find .