how to find a substring in a string without using substr
built in functions, and print the substring found
Answer Posted / lucky
#!/usr/bin/perl
print"enter string
";
$str=<stdin>;
print"enter substring
";
$substr=<stdin>;
if($str=~$substr){
print"valid
";
}
else
{
print"invalid
";
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Which statement has an initialization, condition check and increment expressions in its body? Write a syntax to use that statement.
How to close a file in perl?
Explain the use of 'my' keyword in perl?
What are hashes?
What does the q{ } operator do?
How to turn on Perl warnings? Why is that important?
Define say() function in perl?
How will you declare a variable in perl?
What is q (single q) operator in perl?
How to renaming a file in perl programming?
what is the difference between java and cgi?
Hi, I am a accountant. I am preparing a balance sheet but because of staff shortage and time pressures I cant complete it on time. There is lot of common data with last years which I need not retype and I can manage by editing last year’s balance sheet ? Is their any software on net where I can do this easily??
How many ways can we express string in Perl?
What is use of ‘->’ symbol?
What are the different string manipulation operators in perl?