tomsk tomsk - 3 years ago 188
Perl Question

Perl - take first 16 letters from string

I have a string which contains


How can I take first 16 letters of that string?

Answer Source

Strings are composed of elements called "characters" (which may or may not be bytes). To get a string that consists of the first 16 characters of another string, you can use the following:

 substr($s, 0, 16)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download