Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function split(sourceString,splittingChar,index)
- results={}
- currentWord=""
- for i=1,string.len(sourceString) do
- letter=string.sub(sourceString,i,i)
- if letter==splittingChar then
- results[#results+1]=currentWord
- currentWord=""
- else
- currentWord=currentWord..letter
- end
- end
- results[#results+1]=currentWord
- return results[index], results
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement