Hi Renee

You need to look at two fuctions:-

        left$(string,n)
        right$(string,n)

In your specific example  you need

        left$(example,4) + right$(example,4)

ie take four leftmost characters and concatenate rightmost four
characters ( but see note about trim functions below).

However your positions of the minus signs might vary.

If this is the case also read up on Instr(n,string,substring)

This would allow you to find out the positions of the "-"

eg lnPos = Instr(1,example,"-")

This would return 5 for your example.

mid$(string,nStart,nLength) would also be worth reading up.

With mid$ and Instr you should be able to strip any string to exactly
what you want.


Also read up on ltrim$(string) and rtrim$(string). These will allow you
to remove leading and trailing ( respectively ) spaces from the string.


All of the above functions are standard Basic functions and would be in
virtually all dialects of basic. In Visual Basic you have the options to
drop the $ but the functionality is exactly the same.


Regards



Bob
By Design
www.mapsbydesign.co.uk


In message <0A005268C8DED311A23E0008C75D1EFF095D7BCE@sj-
exchange.ci.sj.ca.us>, Gerasimtchouk, Renee <[EMAIL PROTECTED]
a.us> writes
>Hi all,
>I'm looking for mapbasic syntax to delete two middle numbers within a string
>of numbers.
>Ex.  RA00-12-002
>and I want to delete the -12 so the result would be
>RA00-002
>
>TIA
>
>
>
>---------------------------------------------------------------------
>List hosting provided by Directions Magazine | www.directionsmag.com |
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>Message number: 2860
>

-- 
bob young

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 2866

Reply via email to