Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to insert a tabSpace into a string?

I'm trying to insert a tabSpace into a string:

string ab = "a" + "\t" + "b"

But I got a square instead of space. Please help.

like image 952
Buena Avatar asked Apr 21 '26 14:04

Buena


1 Answers

Your code is correct.

Note that there is no need to use string concatenation. This achieves the same effect:

string ab = "a\tb";

The problem you have is not with creating the string, but with displaying the string. You are probably using a control that doesn't support displaying tabs. It might be better to replace the tabs with spaces.

Related

  • Winforms Label Text property not displaying \t tab character
like image 133
Mark Byers Avatar answered Apr 24 '26 04:04

Mark Byers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!