Multiple choice technology programming languages

Which function can be used to break up a string into more than one part based upon a separator?

  1. chop

  2. split

  3. divide

  4. parse

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The split function in Perl breaks a string into parts based on a separator pattern. It takes the form 'split /pattern/, string' and returns a list of the split elements. Functions like chop remove the last character, while divide and parse are not standard Perl functions for this purpose.