I have seen too many people write function to split string with loop. This maybe not efficient, especially if you want to apply the function with large tables.
The function fn_SplitString here is very simple and it is also very efficient. It does not use any looping. So we can apply it to a large table with very good performance.
I had few very good experience using similar idea to parse address string with large tables in the past.
It uses an internal table master..spt_values from SQL server, which is avaliable for all version of SQL server. This table is also available from Sybase. So this same function and same idea will work with Sybase too.
Currently the function remove the potential empty space at end of begin of the string value, but you may choose not to do that.
If you prefer not to use internal system table, you can use other ways to generate a table with list of numbers.
The function is easy to use, for example:
select stringNumber, stringValue from fn_SplitString('split;my;string;with;a;separator',';')
This is what you get as the result: