Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: samshosho on September 23, 2015, 09:39:39 AM
-
I have a string, that i want to insert at the end of the UIinput value.
So i did this,
CurIndex = UIinput.value.Length;
UIinput.value.Inser(CurIndex, "some string");
It shows the correct index of the UIinput field, however, it won't insert the "some string" at all.
Am i doing something wrong ?
-
any help would be appreciated :)
-
I think this might work:
UIinput.value = UIinput.value + "some string";
-
This is because string.Insert returns the new string you are editing, it doesn't edit the existing one: https://msdn.microsoft.com/en-us/library/system.string.insert(v=vs.110).aspx
betodeoliveira's suggestion will do what you're looking for, the main bit is that he's setting the UIinput.value