+ Reply to Thread
Results 1 to 4 of 4

Splitting Comma Delimited Data

  1. #1
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387

    Splitting Comma Delimited Data

    I have comma delimited data such as OX1024, OX2024, OY2024.

    I'd like to split it based on the commas and trim the extra space.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello yawnzzzz,

    Use the Split function. It returns a zero-based, one-dimensional array containing a specified number of substrings.

    Syntax

    Split(expression[, delimiter[, limit[, compare]]])

    The Split function syntax has these named arguments:

    Part Description
    expression Required. String expression containing substrings and delimiters. If expression is a zero-length string(""), Split returns an empty array, that is, an array with no elements and no data.
    delimiter Optional. String character used to identify substring limits. If omitted, the space character (" ") is assumed to be the delimiter. If delimiter is a zero-length string, a single-element array containing the entire expression string is returned.
    limit Optional. Number of substrings to be returned; –1 indicates that all substrings are returned.
    compare Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings section for values.


    Settings

    The compare argument can have the following values:
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    06-03-2008
    Posts
    387
    If I do this:

    Please Login or Register  to view this content.
    arr will only contain Two and Three?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    arr(0) = "One"
    arr(1) = " Two"
    arr(2) = " Three"
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1