Recent

Author Topic: How to split string ?  (Read 19166 times)

jkeks

  • Newbie
  • Posts: 6
How to split string ?
« on: April 21, 2019, 05:37:39 pm »
I have string:
test - test2

how to split it to array, like in PHP:
$A['test']='test2'


ASerge

  • Hero Member
  • *****
  • Posts: 2223
Re: How to split string ?
« Reply #1 on: April 21, 2019, 05:57:28 pm »
I have string:
test - test2
how to split it to array...
Code: Pascal  [Select][+][-]
  1. {$APPTYPE CONSOLE}
  2. uses SysUtils;
  3.  
  4. var
  5.   A: TStringArray;
  6. begin
  7.   A := 'test-test2'.Split('-');
  8.   Writeln(A[1]);
  9.   Readln;
  10. end.

 

TinyPortal © 2005-2018