Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Akarinnnnn opened this issue Apr 4, 2020 · 2 comments
Closed

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

Akarinnnnn opened this issue Apr 4, 2020 · 2 comments

Comments

@Akarinnnnn
Copy link

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');
@danmoseley danmoseley transferred this issue from dotnet/corefxlab Apr 16, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Console untriaged New issue has not been triaged by the area owner labels Apr 16, 2020
@ghost
Copy link

ghost commented Apr 16, 2020

Tagging subscribers to this area: @eiriktsarpalis, @carlossanlop
Notify danmosemsft if you want to be subscribed.

@adamsitnik
Copy link
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!

@adamsitnik adamsitnik removed the untriaged New issue has not been triaged by the area owner label Jun 24, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants