Hello Monks
I've tried the following code in splitting a string into 4 equal parts separated by a space. I've looking for a good method to refine my code or suggest a good way to do....
use strict; my $tempStr = 'BE65826000483296'; my $tempStr1; while ( $tempStr . length ) { $tempStr1 .= " " . substr( $tempStr, 0, 4 ); $tempStr = substr( $tempStr, 4 ); } $tempStr1 =~ s/^\s//isg; print $tempStr1;
Many Thanks
In reply to Split string into equal parts by kalyanrajsista
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |