Why is a string printed as a unicode character rather than readable text in C#? -


i have string create get; set;:

public static string userdirinput { get; set; }

i use console.read(); give value:

userdirinput = convert.tostring(console.read());

and before go compare print out :

console.write("read " + (string)userdirinput);

its printing out unicode values , not readable text...

what do print out readable text?

you want use console.readline, returns string. console.read reads single character, , returns int32. if cast char, you'd see reading first letter user typed, not entire string.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -