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