int stxval = 0x02; //found this value on wikipedia string mystring = "Hello"; StringBuilder builder = new StringBuilder(mystring); builder.Append(stxval);
Here in the line "2Hello" added. How to get a line in this "Hello" form?
"2Hello"
Use char instead:
char
char stx = '\u0002';
or
char stx = (char) 2;
Personally, I prefer the first option, but it is up to you.
Anyway, just use:
StringBuilder builder = new StringBuilder(mystring); builder.Append(stx);
builder.Append((char)stxval);
otherwise it will just add int.ToString()
int.ToString()