Perl: String Operations
String extraction is done with
The form is:
substr($myString, offset index, number of characters to extract).
# -*- coding: utf-8 -*- # perl # substring. 2nd arg is begin index, 3rd arg is count print substr('012345', 2, 2); # prints 23
Length of string is
String Join and Repetition
In Perl, string join is done with a dot.
$astr= "under" . "stand";
String repetition is done with the operator
print 'abc' x 2;