[Gambas-user] Split and escape characters

Maximillian Von Kloisterheim maximvonk at ...626...
Tue Apr 8 09:53:15 CEST 2008


richard terry wrote:
> "Escape is an escape character. Any separator characters enclosed between two 
> escape characters are ignored in the splitting process. If Escape contains 
> two characters, then the first is the starting escape character, and the 
> second the ending one. "
> 
> So says the Docs, escape is even underlined.
> 
> For a dummy line me What are escape characters? (I mean not just what they do, 
> but can someone list them, show an example)
> 
> 
> Thanks.
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> Register now and save $200. Hurry, offer ends at 11:59 p.m., 
> Monday, April 7! Use priority code J8TLD2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 


Hey Richard - Try this:

Dim SPL as String[]
Dim MSG as string

MSG = "This Line,Is Split at,The Commas"

SPL = Split(MSG, ",")

You can now read the contents of SPL[0] etc

The comma is used as an escape char in this case, although it can be 
quite a few other symbols. Be careful though, because not all of the 
symbols you can type can be used it seems, but # @ ~ ^ all seem to work.

Regards

Max




More information about the User mailing list