Results 1 to 3 of 3

Thread: String containing an index of an array?

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

    Default String containing an index of an array?

    Simba Code:
    for i := 0 to Number do
      begin
         if ArrInStr(Array, String) then
         begin
           (Some Function to return the index of the array found in the string)
           Break;
           end;
      end;

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

    Default

    I believe you're looking for something like the code below:
    (ALSO - Check out Janilabo's string handling commands in my signature! ;] )
    Simba Code:
    {$i srl/srl.simba}
    var
      index: Integer;
      s: string;
      TSA: TStringArray;
    begin
      s := 'foo';
      TSA := ['hello', 'world', 'foo', 'new', 'object'];
      if (InStrArrEx(s, TSA, index)) then
        Writeln('Saved index = ' + IntToStr(index) + '.');
    end.

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

    Default

    i love you

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
  •