Substr() in Perl…

It can be done as follows :-

Following is the example code showing its basic usage:

#!/usr/bin/perl -w

$temp = substr("okay", 2);
print "Substring valuye is $temp\n";

$temp = substr("okay", 1,2);
print "Substring valuye is $temp\n";

O/p

Substring valuye is ay
Substring valuye is ka

Leave a Reply