how to find a substring in a string without using substr
built in functions, and print the substring found
Answer Posted / garg
#! /user/bin/perl
$str="Yashwanth";
$n="wan";
if ($str=~ $n)
{
print $n;
}
| Is This Answer Correct ? | 4 Yes | 6 No |
Post New Answer View All Answers
How to know whether a key exists or not in perl?
What does localtime() do in perl?
How to print escaping characters inside a string in perl?
Explain arrays in perl.
List the files in current directory sorted by size ?
How can the user execute a long command repeatedly without typing it again and again?
How can you call a subroutine and identify a subroutine?
Is perl a case sensitive language?
what is perl language?
What is the difference between single (') and double (") quote in a string in perl?
Explain about typeglobs?
Explain ivalue?
Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?
Why to use perl scripting?
What is the use of -n and -p options?