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

Answer Posted / yashwanth

$r="YASHWANTH";

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

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

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a chop() function in perl?

542


Explain lists ?

508


What are the purpose of close(), getc() and read() functions?

467


What is the use of '>>' in perl?

520


What are perl variables?

499






How to connect to SQL server through Perl?

548


How to open a directory in perl?

508


Which of these is a difference between Perl and C++ ?

550


Explain ivalue in perl?

506


Why to use perl?

520


If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?

487


Write a program to decode the data in the form using cgi programming

523


What are the different types of perl operators?

500


what is the function of Return Value?

540


How do I replace every character in a file with a comma?

509