Split() Where Cursor is

craigachan

Registered User.
Local time
Today, 04:42
Joined
Nov 9, 2007
Messages
285
Can anyone tell me if it is possible to split a string where you place the cursor?

Thanks.
 
I would say likely but it requires more information as to what you are trying to do and the objects with which you are working and where you want the output to go.
 
Should be possible. Look at the SelStart property, and the Left() and Mid() functions.
 
That's it! It's exactly what I needed. Basically I want to use the split function to divide textbox string so I can insert other text from another listbox that I click. this will work great. What I'll do is when I click the position of the curser, this will split the string into 2. then I'll reassemble array(0) & newtext & array(1) and replace my original txtbox.

Any other more efficent way of doing this?
 
Don't really need an array, but you can have a first half and second have variable which then you concatenate the other part in and set the value.
 
I guess I need to use Mid() instead of array(). But it works great.
 

Users who are viewing this thread

Back
Top Bottom