Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

writing 'TAB' character to a text file in objective-c?

What do I need to use to write out my TAB character?

like image 437
Slee Avatar asked Nov 22 '10 15:11

Slee


1 Answers

Use the escape character \t in a string literal to print a tab:

NSString *string = @"This is a tab:\tThis is tabbed!\n";

You can put \t in any string literal and do with it what you want from there: write it to a file, to STDOUT, whatever.

like image 165
Wyatt Anderson Avatar answered Nov 07 '22 15:11

Wyatt Anderson