Thx much! Good stuff for those of us just getting started to play with.
~ -----Original Message-----
~ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
~ Sent: Sunday, January 02, 2000 5:20 PM
~ To: [EMAIL PROTECTED]
~ Subject: [REBOL] Basic string functions? Re:
~
~
~ Donald Dalley wrote:
~ > I don't use REBOL for parsing yet, but someone else is asking me:
~ >
~ > Does anyone know if/when basic string functions** are going to be
~ added to REBOL/Core or parse, or am I missing something in the docs?
~ >
~ > **you know, LEFT, RIGHT, LENGTH, etc.
~
~ Here's some:
~
~ >> string: "hello"
~ == "hello"
~ >> length? string
~ == 5
~ >> left: func [S [string!] N [integer!]] [copy/part S N]
~ >> left string 2
~ == "he"
~ >> right: func [S [string!] N [integer!]] [copy/part at S (length? S) -
~ N + 1 N]
~ >> right string 3
~ == "llo"
~ >> mid: func [S [string!] I [integer!] N [integer!]] [copy/part at S I
~ N]
~ >> mid string 2 3
~ == "ell"
~
~ I can't remember if there's any others. Everyone is free to use the
~ above as they wish.
~ Oh, and if you change the "[string!]" to "[series!]", they'll work on
~ blocks as well as strings. :-D
~
~ I hope that helps!
~
~ Andrew Martin
~ BASIC REBOL...
~ [EMAIL PROTECTED]
~ http://members.xoom.com/AndrewMartin/
~ Online @ 33,600 Baud!
~ -><-
~
~