Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / 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

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

Answer / garg

#! /user/bin/perl
$str="Yashwanth";
$n="wan";
if ($str=~ $n)
{
print $n;
}

Is This Answer Correct ?    4 Yes 6 No

Post New Answer

More CGI Perl Interview Questions

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

3 Answers   Nokia,


How do you turn on the perl warnings?

0 Answers  


How are parameters passed to subroutines in perl?

0 Answers  


How can the user execute a long command repeatedly without typing it again and again?

0 Answers  


What is -> symbol in perl?

0 Answers   HCL,


What are the features of perl language?

0 Answers  


Define print() function in perl?

0 Answers  


What are the advantages and disadvantages of perl language?

0 Answers  


Explain perl. What are the advantages of programming in perl?

0 Answers  


How to prevent file truncation in perl?

0 Answers  


How to check the status of airplane mode (enable/disable) in perl for Android mobile?

0 Answers  


Write a program to show the process of spawning a child process

0 Answers  


Categories