Skip to content

Add a console read function: Console.ReadLine(char delim) #35063

Closed

Description

@Akarinnnnn

Here is a simple implementation.

public static string ReadLine(char delim = '\n')
{
    var data = new StringBuilder(80);
    for (char ch = (char)Console.Read(); ch != delim; ch = (char)Console.Read())
        data.Append(ch);

    return data.ToString();
}

and an example:

string datajson = ReadLine('\0');

Activity

  1. added
    untriaged
    on Apr 16, 2020
  2. adamsitnik commented on Jun 24, 2020

    @adamsitnik
    Member

    Hello @Akarinnnnn

    It looks like it's a duplicate of #800 Could you please take a look at #800 and specify your requirements there?

    Thank you!

  3. removed
    untriaged
    on Jun 24, 2020
  4. ghost locked as resolved and limited conversation to collaborators on Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions