Can we replace text with position

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

Can we replace text with position

Post by samjith » Thu Sep 10, 2015 10:13 am

I need to replace some text,
1. I don't know what is that text.
2. I know the position of the text,
3. I don't want to change any text other than that text

eg: This is an sample text splitted with tab 10 100 10 tab

seperated line with tab (not space)

I need to replace word with position 6 ("tab") with "my name"
But i don't want to change the second word "tab"

samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

Re: Can we replace text with position

Post by samjith » Thu Sep 10, 2015 10:14 am

Eg: This is____an_______sample________text_______splitted with_______tab______10______100_______10_______tab

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Can we replace text with position

Post by Klaus » Thu Sep 10, 2015 12:20 pm

Namaste samjith,

the magic word is "itemdelimiter" :D
Then it is a simple as this:
...
set itemdel to TAB
put "your name" into item 6 of tText
...


Best

Klaus

samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

Re: Can we replace text with position

Post by samjith » Thu Sep 10, 2015 12:40 pm

Namaste Kiaus,

Thanks for this code,
put "your name" into item 6 of tText, that is what i want :D

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Can we replace text with position

Post by Klaus » Thu Sep 10, 2015 1:18 pm

samjith wrote:put "your name" into item 6 of tText, that is what i want :D
Yes, I know what is good for you! :D

Post Reply