Sunday, 8 September 2013

string compression in c# lanague

string compression in c# lanague

I have a c program which does the string compression successfully in c
language and its a brute force approach there in C language.for exaplme if
input is aabccccddddddddddd then output should be a2bc3d11.
I solved this in c language by taking each character and counting number
of its occurences and then printing that character and its count.
I am trying to convert this to c# langauge.I am wondering it should be
easy to do in the c# language because of so many string and char built in
methods.
Is there a way we can do this in c# by using lambda expressions or build
in methods of string or char type in very few lines?

No comments:

Post a Comment