Split a comma separated string into swift array

If you have got a string which is separated using any delimiter like ‘,’ or space or ‘|’ or any other fixed delimiter, you can easily split it in swift by using the following function