delete end chars

Peter Haworth pete at lcsql.com
Sun Aug 24 13:19:04 EDT 2014


Couple of other ways using regex.

get matchText(tString1,"(.*)" & tString2 & "$",tString1)

Or

if matchChunk(tString1,"(.*)" & tString2 & "$",tString1,tStart,tEnd) then
   delete char tStart to tEnd of tString1
end if

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>


On Sun, Aug 24, 2014 at 9:28 AM, Peter Haworth <pete at lcsql.com> wrote:

> if tString1 ends with tString2 then
>    delete char (the length of tString1 - the length of tString2 +1 ) to -1
> of tString1
> end if
>
> Pete
> lcSQL Software <http://www.lcsql.com>
> Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
> SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
>
>
> On Sun, Aug 24, 2014 at 8:12 AM, JB <sundown at pacifier.com> wrote:
>
>> Hi,
>>
>> Thanks for the reply.
>>
>> I am saying if I have “ABC” in one string and the other string
>> has “KCFAJFCABC” then I want to delete the “ABC” from
>> the end of the second string leaving “KCFAJFC”.
>>
>> John Balgenorth
>>
>>
>> On Aug 24, 2014, at 8:09 AM, dunbarx at aol.com wrote:
>>
>> > Hi.
>> >
>> >
>> > Are you saying that if you have "ABCD" and somewhere else you have:
>> "AXFRZC" that you want to delete the "C" from the first string?
>> >
>> >
>> > Whatever you want, the chunking and text control within LC is more than
>> adequate to do the job, and will be fun do execute as well. But is this
>> what you meant?
>> >
>> >
>> > Craig Newman
>> >
>> >
>> >
>> > -----Original Message-----
>> > From: JB <sundown at pacifier.com>
>> > To: How to use LiveCode <use-livecode at lists.runrev.com>
>> > Sent: Sun, Aug 24, 2014 10:16 am
>> > Subject: delete end chars
>> >
>> >
>> > If I have a certain amount of characters
>> > and I want to check the end of another
>> > line of characters to see if they are there
>> > and if so then delete them what is the
>> > fastest way to do delete the characters
>> > at the end of the specified line?
>> >
>> > _______________________________________________
>> > use-livecode mailing list
>> > use-livecode at lists.runrev.com
>> > Please visit this url to subscribe, unsubscribe and manage your
>> subscription
>> > preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>> >
>> >
>> > _______________________________________________
>> > use-livecode mailing list
>> > use-livecode at lists.runrev.com
>> > Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>> >
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>



More information about the use-livecode mailing list