pastebin

Paste Search Dynamic
Recent pastes
string GeeksForGeeks
  1. #!/usr/bin/perl
  2.  
  3. # String to be passed
  4. $string = "GeeksForGeeks";
  5.  
  6. # Calling substr() to find string
  7. # by passing negative index
  8. $sub_string1 = substr($string, -4);
  9.  
  10. # Printing the substring
  11. print "Substring 1 : $sub_string1\n";
  12.  
  13. # Calling substr() to find the
  14. # substring by passing negative length
  15. $sub_string2 = substr($string, 4,);
  16.  
  17. # Printing the substring
  18. print "Substring 2 : $sub_string2 ";
  19.  
Parsed in 0.004 seconds