Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Daisy Brown   on Feb 17 In MS Office Category.

  
Question Answered By: Kiet Jainukul   on Feb 17

The delimiter character(s) with the characters in the string  being
split.

I found this under "Option Compare Statement" in the help  file:

Option Compare binary  results in string comparisons based on a sort
order derived from the internal binary representations of the
characters. In Microsoft Windows, sort order is determined by the code
page. A typical binary sort order is shown in the following example:

A < B < E < Z < a < b < e < z < À < Ê < Ø < à < ê <
ø

Option Compare text  results in string comparisons based on a
case-insensitive text sort order determined by your system's locale.
When the same characters are sorted using Option Compare Text, the
following text sort order is produced:

(A=a) < ( À=à) < (B=b) < (E=e) < (Ê=ê) < (Z=z) <
(Ø=ø)

Translated it seems to mean approximately:
Case sensitive.. or not.

Eg.
Firstly with a textual comparison  (comparison type  = 1):
x = Split("abtcdeTfgthi", "T", -1, 1)
leaves x as a Variant/String(0 to 3) containing the following
elements:
x(0) : "ab"
x(1) : "cde"
x(2) : "fg"
x(3) : "hi"
Note that both "t" and "T" act as delimiters.

Changing only the comparison type to 0 (that's a binary comparison):
x = Split("abtcdeTfgthi", "T", -1, 0)
leaves x as a Variant/String(0 to 1):
x(0) : "abtcde"
x(1) : "fgthi"
Here only "T" acts as a delimiter.

Share: 

 
 
Didn't find what you were looking for? Find more on String-Split Function parameter "compare" Or get search suggestion and latest updates.


Tagged: