- Joined
- Sep 30, 2009
- Messages
- 698
Is there another way than using
I need this for my the UI System I am creating which will use Texttags with automatized line break so I have written myself a small library, but I am not sure if it would work correctly:
SubString(string, x, x +1)
?I need this for my the UI System I am creating which will use Texttags with automatized line break so I have written myself a small library, but I am not sure if it would work correctly:
JASS:
library SubStringLastWord
function SubStringLastWord takes string s, integer start, integer end returns string
local string sub = SubString(s, start, end)
local string sub2 = ""
local integer End = end
loop
exitwhen sub != " " and sub2 == " "
set End = End - 1
set sub2 = sub
set sub = SubString(s, End - 1, End)
endloop
set sub = SubString(s, start, End + 1)
return sub
endfunction
endlibrary