OurSonic.UIManager.TextBox.SelectWord C# (CSharp) Method

SelectWord() private method

private SelectWord ( ) : void
return void
        private void SelectWord()
        {
            var j = Text.Split(" ");

            var pos = 0;
            for (var i = 0; i < j.Length; i++) {
                if (CursorPosition < j[i].Length + pos) {
                    DragPosition = pos;
                    CursorPosition = j[i].Length + pos;
                    return;
                } else
                    pos += j[i].Length + 1;
            }

            DragPosition = pos - j[j.Length - 1].Length;
            CursorPosition = Text.Length;
        }