Results 1 to 6 of 6

Thread: Make a string into an array

  1. #1
    Join Date
    Feb 2013
    Posts
    89
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default Make a string into an array

    how would i take a string that is a sentence and has spaces, and convert it into an array splitting the words by spaces.

    or see if the first word in the sentence is contained in the array, then the second word in the second array and so on!
    Last edited by xxpoopyxx; 03-13-2013 at 01:25 AM.

  2. #2
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Uhh try ExplodeWrap(); or ImplodeWrap();, i'm not too sure which one it is >_<

  3. #3
    Join Date
    Feb 2013
    Posts
    89
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    not sure how to use this but i will look into it

  4. #4
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Simba Code:
    {$include_once srl/srl.simba}
    var
      s: string;
      TSA: TStringArray;
    begin
      SetupSRL;
      s := 'hellow world';
      TSA := Explode(' ', s);
      Writeln(TSA);
    end.
    Note the original function:
    Simba Code:
    Explode(del: string; str: string): TStringArray;
    del: string is your delimiter in which marks where to break the string, str, up into pieces, resulting in a TStringArray, TSA.

  5. #5
    Join Date
    Feb 2013
    Posts
    89
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Thanks for everyone's help especially le jingle

  6. #6
    Join Date
    Oct 2012
    Location
    Italy
    Posts
    145
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    Simba Code:
    {$include_once srl/srl.simba}
    var
      s: string;
      TSA: TStringArray;
    begin
      SetupSRL;
      s := 'hellow world';
      TSA := Explode(' ', s);
      Writeln(TSA);
    end.
    Note the original function:
    Simba Code:
    Explode(del: string; str: string): TStringArray;
    del: string is your delimiter in which marks where to break the string, str, up into pieces, resulting in a TStringArray, TSA.
    +1 I like this way to work with strings
    Check out my new script here: http://villavu.com/forum/showthread.php?p=1194418 Al-Kharid Silk buyer

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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