Page 1 of 1

REplace issue in livecode

Posted: Tue Jan 14, 2025 8:08 am
by helenecrane
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?

Re: REplace issue in livecode

Posted: Tue Jan 14, 2025 3:54 pm
by Klaus
Hi Helen,

welcome to the forum!

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

Best

Klaus

Re: REplace issue in livecode

Posted: Wed Jan 15, 2025 3:26 am
by dunbarx
What is it about myHtml that is different from "normal" text?

Craig

Re: REplace issue in livecode

Posted: Wed Jan 15, 2025 5:49 am
by scott_morrow
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/>"

Re: REplace issue in livecode

Posted: Wed Jan 15, 2025 8:52 am
by richmond62
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)

Re: REplace issue in livecode

Posted: Wed Jan 15, 2025 10:10 am
by helenecrane
Thanks for your answer. I got it.

Re: REplace issue in livecode

Posted: Wed Jan 15, 2025 11:09 am
by Klaus
It would be good style to tell us what the problem and its solution was! 8)

Re: REplace issue in livecode

Posted: Wed Jan 15, 2025 6:09 pm
by jacque
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