text - Assembly, how to read something from a txt? -
i need read phrase , how many times appears each letter, example:
"hello sir" h=1, e=1 , l=2, o=0, s=, i=1, r=1
but dont know how take text txt , use on assembly code.
using (var sr = new streamreader(@"c:\test.txt")) { var str = sr.readtoend(); var charlist = str.distinct().tolist(); foreach (var chr in charlist) { var count = str.count(x => x == chr); console.writeline(string.format("{0} : {1}", chr, count)); } }
Comments
Post a Comment