String Arrays

A file that stores type functions to manipulate TStringArrays.

The source for this file can be found here.

TStringArray.addIndex

procedure TStringArray.addIndex(const str : String; const index : Integer);

Used to add a value to a TStringArray at a chosen index.

Note

  • by Zyt3x

Example:

TSA.addIndex('new entry', 0);

TStringArray.deleteIndex

procedure TStringArray.deleteIndex(const index : Integer);

Used to delete a value of a TStringArray at a chosen index.

Note

  • by Zyt3x

Example:

TSA.deleteIndex(0);

TStringArray.append

procedure TStringArray.append(const str : String);

Used to append a value to a TStringArray.

Note

  • by Zyt3x

Example:

TSA.append('new entry');

TStringArray.combine

procedure TStringArray.combine(const arr : TStringArray);

Used to combine two TStringArray variables.

Note

  • by Zyt3x

Example:

TSA.combine(TSA2);

TStringArray.returnInArray

function TStringArray.returnInArray(const str : String) : Integer;

Returns the index of where the value was found in a TStringArray. Returns -1 if not found.

Note

  • by Zyt3x

Example:

writeLn(TSA.returnInArray('new entry'));

TStringArray.isInArray

function TStringArray.isInArray(const str : String) : Boolean;

Returns True if the value is present in the TStringArray.

Note

  • by Zyt3x

Example:

writeLn(TSA.returnInArray('new entry'));

TStringArray.include

function TStringArray.include(const arr : TStringArray) : TStringArray;

Returns a TStringArray which contains values that are present in both arrays.

Note

  • by Zyt3x

Example:

TSA := TSA2.include(TSA);

TStringArray.exclude

function TStringArray.exclude(const arr : TStringArray) : TStringArray;

Returns a TStringArray which contains values that are not present in both arrays.

Note

  • by Zyt3x

Example:

TSA := TSA2.exclude(TSA);

TStringArray.swap

procedure TStringArray.swap(var arr : TStringArray);

Used to swap two TStringArray variables.

Note

  • by Zyt3x

Example:

TSA.swap(TSA2);

TStringArray.clearEquals

procedure TStringArray.clearEquals();

Used to clear duplicates in a TStringArray.

Note

  • by Zyt3x

Example:

TSA.clearEquals();

TStringArray.invert

procedure TStringArray.invert();

Used to invert the TStringArray.

Note

  • by Zyt3x

Example:

TSA.invert();

TStringArray.explodeArr

function TStringArray.explodeArr(const delArr : TStringArray): T2DStringArray;
Used to explode the TStringArray using different del strings.
Requires the length of delArr to be the same as the length of the string array.

Note

  • by Zyt3x

Rename this to “TStringArray.explode” once lape requires “self” for internal things.

Example:

s2DArr := sArr.explodeArr(['divider1', ...]);

TStringArray.explodeArr: overload;

function TStringArray.explodeArr(const del : String): T2DStringArray; overload;

Used to explode the TStringArray. Uses a string instead of an array of strings.

Note

  • by Zyt3x

Rename this to “TStringArray.explode” once lape requires “self” for internal things.

Example:

s2DArr := sArr.explodeArr('divider');

TStringArray.implodeArr

function TStringArray.implodeArr(const glue : String): String;

Used to implode the TStringArray.

Note

  • by Zyt3x

Rename this to “TStringArray.implode” once lape requires “self” for internal things.

Example:

S := sArr.implodeArr('glue');

TStringArray.toLowerCase

procedure TStringArray.toLowerCase();

Used to lowercase a TStringArray.

Note

  • by Zyt3x

Example:

TSA.toLowerCase();

TStringArray.toUpperCase

procedure TStringArray.toUpperCase();

Used to uppercase a TStringArray.

Note

  • by Zyt3x

Example:

TSA.toUpperCase();

TStringArray.toCapitalize

procedure TStringArray.toCapitalize();

Used to capitalize a TStringArray.

Note

  • by Zyt3x

Example:

TSA.toCapitalize();

TStringArray.toString

function TStringArray.toString() : String;

Used to turn a TStringArray into a string.

Note

  • by Zyt3x

Example:

writeLn(TSA.toString());

T2DStringArray.implodeArr

function T2DStringArray.implodeArr(const glueArr : TStringArray): TStringArray;
Used to implode the T2DStringArray.
Requires the length of glueArr to be the same as the length of the string array.

Note

  • by Zyt3x

Rename this to “T2DStringArray.implode” once lape requires “self” for internal things.

Example:

sArr := s2DArr.implodeArr(['glue1', ...]);

T2DStringArray.implodeArr: overload;

function T2DStringArray.implodeArr(const glue : String): TStringArray; overload;

Used to implode the T2DStringArray using glue strings. Uses a string instead of an array of strings.

Note

  • by Zyt3x

Rename this to “T2DStringArray.implode” once lape requires “self” for internal things.

Example:

sArr := s2DArr.implodeArr('glue']);

TStringArray.shuffle

procedure TStringArray.shuffle

Shuffles (randomly sorts) all of the elements in the array.

Note

  • by The Mayor (commited by loginor from The Mayor’s TIntegerArray.shuffle)

Example:

TSA.shuffle();