7 kyu

Split string by multiple delimiters

390 of 688zofy

Description:

Your task is to write function which takes string and list of delimiters as an input and returns list of strings/characters after splitting given string.

Example:

multiple_split('Hi, how are you?', [' ']) => ['Hi,', 'how', 'are', 'you?']
multiple_split('1+2-3', ['+', '-']) => ['1', '2', '3']
multipleSplit('Hi, how are you?', [' ']) => ['Hi,', 'how', 'are', 'you?']
multipleSplit('1+2-3', ['+', '-']) => ['1', '2', '3']

List of delimiters is optional and can be empty, so take that into account.

Important note: Result cannot contain empty string.

Fundamentals
Algorithms
Arrays
Strings
Logic

More By Author:

Check out these other kata created by zofy

Stats:

CreatedJun 7, 2016
PublishedJun 8, 2016
Warriors Trained1691
Total Skips50
Total Code Submissions6259
Total Times Completed688
JavaScript Completions321
Python Completions390
Total Stars29
% of votes with a positive feedback rating85% of 189
Total "Very Satisfied" Votes145
Total "Somewhat Satisfied" Votes32
Total "Not Satisfied" Votes12
Ad
Contributors
  • zofy Avatar
  • smile67 Avatar
  • Chrono79 Avatar
  • Haksell Avatar
Ad