Check out example codes for "perl last characters". It will help you in understanding the concepts better.

Code Example 1

# For Perl (language) only

# syntax
substr(<your-string>,-<characters-to-extract>)

# example 
substr("Glass half empty, glass half full",-15)

# application
my $sRandom = "Glass half empty, glass half full";
my $sLastFewChars = substr($sRandom,-15);
print "[ sRandom : '$sRandom' ] \n[ sLastFewChars : '$sLastFewChars' ]" . "\n";

Learn ReactJs, React Native from akashmittal.com