 | CSTRiTokenize Method |
Tokenize a string based on any characters.
Namespace:
GeoEngine.Core.GXNetX
Assembly:
geoengine.core.gxnetx (in geoengine.core.gxnetx.dll) Version: 2024.2.0.25
Syntaxpublic static int iTokenize(
CGXNETCore gxNetShared,
ref string str_val,
string soft,
string hard,
string esc,
string quote
)
public static int iTokenize(
CGXNETCore gxNetShared,
ref string str_val,
string soft,
string hard,
string esc,
string quote
)
Public Shared Function iTokenize (
gxNetShared As CGXNETCore,
ByRef str_val As String,
soft As String,
hard As String,
esc As String,
quote As String
) As Integer
Public Shared Function iTokenize (
gxNetShared As CGXNETCore,
ByRef str_val As String,
soft As String,
hard As String,
esc As String,
quote As String
) As Integer
public:
static int iTokenize(
CGXNETCore^ gxNetShared,
String^% str_val,
String^ soft,
String^ hard,
String^ esc,
String^ quote
)
public:
static int iTokenize(
CGXNETCore^ gxNetShared,
String^% str_val,
String^ soft,
String^ hard,
String^ esc,
String^ quote
)
static member iTokenize :
gxNetShared : CGXNETCore *
str_val : string byref *
soft : string *
hard : string *
esc : string *
quote : string -> int
static member iTokenize :
gxNetShared : CGXNETCore *
str_val : string byref *
soft : string *
hard : string *
esc : string *
quote : string -> int
Parameters
- gxNetShared
- Type: GeoEngine.Core.GXNetXCGXNETCore
A shared CGXNETCore - str_val
- Type: SystemString
STR - String containing token(s) - soft
- Type: SystemString
szSoft - Soft delimiters (spaces/tabs) - hard
- Type: SystemString
szHard - Hard delimiters (commas) - esc
- Type: SystemString
szEsc - Escape delimiters (back-slash) - quote
- Type: SystemString
szQuote- Quote delimiters (quote characters)
Return Value
Type:
Int32Number of tokens
Remarks
This uses a finite state machine to tokenize on these
rules:
1. Any one character following an escape delimiter is
treated as a normal character.
2. Any characters inside a quote string are treated as
normal characters.
3. Any number of Soft delimiters in sequence without a
hard delimiter are treated as one hard delimited.
4. Any number of soft delimiters can preceed or follow
a hard delimiter and are ignored.
EXAMPLE
Soft = [ ] Hard = [,] Escape = [\] Quote = ["]
[this is a , , the "test," of , \,\" my delimite fi,]
Results in:
[this] [is] [a] [] [the] ["test,"] [of] [\,\"] [my] [delimite] [fi] []
NOT use this function except in GXC code. The corresponding
etToken_STR function will not operate correctly in GX.Net code.
See Also