|
|
| There's more than one way to do things | |
| PerlMonks |
How do I expand tabs in a string?by faq_monk (Initiate) |
| on Oct 08, 1999 at 00:20 UTC ( [id://596]=perlfaq nodetype: print w/replies, xml ) | Need Help?? |
|
Current Perl documentation can be found at perldoc.perl.org. Here is our local, out-dated (pre-5.6) version: You can do it yourself:
1 while $string =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e; Or you can just use the Text::Tabs module (part of the standard perl distribution).
use Text::Tabs;
@expanded_lines = expand(@lines_with_tabs);
|
|