Please enable JavaScript to view this site.

Codolex

Navigation: Activities > String utils

String conversion

Scroll Prev Top Next More

The string conversion activity can be used to convert a string to another variable type or to upper/lower case the string.

 

StringConversion

Activity properties

 

Possible variable types to convert to:

 

Boolean

Is true except when value is of the string is 'False'

 

Example:

String = "anything"

 

begin

var ConvertedString: Boolean;

 ConvertedString := StringToConvert.ToBoolean;

end;

Result = True

 

CharArray (TArray<Char>)

 

Example:

String = "hello world"

 

begin

var ConvertedString: TArray<Char>;

 ConvertedString := StringToConvert.ToCharArray;

end;

Result = ['H','e','l','l','o',' ','w','o','r','l','d']

 

Decimal (Double)

 

Example:

String = "3.5" (or "3,5" depending on settings)

 

begin

var ConvertedString: Double;

 ConvertedString := StringToConvert.ToDouble;

end;

Result = 3.5

 

Extended

 

Example:

String = "3.5" (or "3,5" depending on settings)

 

begin

var ConvertedString: Extended;

 ConvertedString := StringToConvert.ToExtended;

end;

Result = 3.5

 

Bigint (Int64)

 

Example:

String = "34214"

 

begin

var ConvertedString: Int64;

 ConvertedString := StringToConvert.ToInt64;

end;

Result = 34214

 

Integer

 

Example:

String = "34214"

 

begin

var ConvertedString: Integer;

 ConvertedString := StringToConvert.ToInteger;

end;

Result = 34214

 

Single

 

Example:

String = "34214"

 

begin

var ConvertedString: Single;

 ConvertedString := StringToConvert.ToSingle;

end;

Result = 34214

 

Other conversions:

 

Lowercase

 

Example:

String = "Hello world"

 

begin

var ConvertedString: Single;

 ConvertedString := StringToConvert.ToSingle;

end;

Result = hello world

 

Uppercase

 

Example:

String = "Hello world"

 

begin

var ConvertedString: Single;

 ConvertedString := StringToConvert.ToSingle;

end;

Result = HELLO WORLD

© by GDK Software