in reply to Re: Counting to add space to a string
in thread Counting to add space to a string
Thanks!#!/usr/bin/perl use strict; use warnings; my $account_1 = "CALI123456-09"; my $account_2 = "FLOR1234567-01"; my $total_count_1 = length($account_1); print "Account 1 has $total_count_1 characters\n"; if($total_count_1 < 23) { substr($account_1, 4, 0) = ' '; print "\n^$account_1^\n"; } print "\n*$account_1*\n"; print "*$account_2*\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Counting to add space to a string
by Anonymous Monk on Sep 22, 2011 at 17:27 UTC |