REplace issue in livecode

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
helenecrane
Posts: 3
Joined: Tue Jan 14, 2025 8:03 am

REplace issue in livecode

Post by helenecrane » Tue Jan 14, 2025 8:08 am

Hello,
I'm new to LiveCode. I need to replace " snn" with "" & " sss" & "" in myHtml. it will replace all " snn" with " sss". but it will not work in the begin of a line(newline, \n).
Is there anyone having the same issue? How to fix it?

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

Re: REplace issue in livecode

Post by Klaus » Tue Jan 14, 2025 3:54 pm

Hi Helen,

welcome to the forum!

What did you script so far?
Please post your script(s).

Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: REplace issue in livecode

Post by dunbarx » Wed Jan 15, 2025 3:26 am

What is it about myHtml that is different from "normal" text?

Craig

scott_morrow
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 38
Joined: Tue Jun 27, 2006 8:35 pm
Contact:

Re: REplace issue in livecode

Post by scott_morrow » Wed Jan 15, 2025 5:49 am

When you say that "it will not work" do you mean that the leading white space in " sss" is not included in the replace... or something else?
Also, I am uncertain why there is an empty "" concatenated to the front and back of " sss". I wouldn't think that this would be functionally different from just " sss"
Additionally, you use "\n" to represent a new line which I assume is additional clarification for us about what "new line" means. I wouldn't actually expect to see "\n" used in html but rather "<br/>"
Elementary Software
...now with 20% less chalk dust!

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10078
Joined: Fri Feb 19, 2010 10:17 am

Re: REplace issue in livecode

Post by richmond62 » Wed Jan 15, 2025 8:52 am

It is possible the OP is a bot: they joined the day that was posted and seems to have no direct connexion with LC as it concerns HTML.

Whoops: I apologise. 8)
Last edited by richmond62 on Wed Jan 15, 2025 10:47 am, edited 1 time in total.

helenecrane
Posts: 3
Joined: Tue Jan 14, 2025 8:03 am

Re: REplace issue in livecode

Post by helenecrane » Wed Jan 15, 2025 10:10 am

Thanks for your answer. I got it.

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

Re: REplace issue in livecode

Post by Klaus » Wed Jan 15, 2025 11:09 am

It would be good style to tell us what the problem and its solution was! 8)

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: REplace issue in livecode

Post by jacque » Wed Jan 15, 2025 6:09 pm

richmond62 wrote:
Wed Jan 15, 2025 8:52 am
It is possible the OP is a bot: they joined the day that was posted and seems to have no direct connexion with LC as it concerns HTML.

Whoops: I apologise. 8)
I'm on the fence for this one. For someone new to LC she seems to know a lot about LC in another very old thread. viewtopic.php?f=11&t=39417&p=232984#p232984
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply