I was wondering if anyone knows the way to break down a single string into individual components? I've been looking around and I can't seem to find anything of use. Although I did stumble across the 'TStringList' type, although I'm not completely sure where it's used and what it's used for.
What would really be wonderful is a function to extract all the string characters from a single string and output a TStringArray containing each character. Also a function to do just the opposite.
An example would be:
Simba Code:Procedure FunWithStrings;
var
Text,NewStr: String;
StrComps: TStringArray;
begin
Text := 'Hey';
StrComps := ExtractString(Text); //This would return ['H', 'e', 'y']
NewStr := CompressStrAr(StrComps); //This would return 'Hey'
end;
Sometimes it's easier to explain something through code.![]()







Reply With Quote




