CGI Perl Question:
Download Questions PDF

How to find a substring in a string without using substr built in functions, and print the substring found?

Answer:

$r="YASHWANTH";

@n=split (//,$r);
print "@n\n";
@t=splice(@n,0,3);

print "@t\n";
$r=join("",@t);
print "$r\n";
~
~

Download CGI Perl Interview Questions And Answers PDF

Previous QuestionNext Question
Sort a word "system" in perl/shell without using built in functions output should be emssty?Write a script to reverse a string without using Perls built in function?