RemoveChars

Removes characters from a string.

Method Signature

RemoveChars(string=[string], start=[integer], count=[integer])

Arguments

Argument
Type
Required
Description
Default

string

string

true

The string to remove characters from.

start

integer

true

The one-based index position of the first character to remove.

count

integer

true

The number of characters to remove.

Examples

Remove a string

Run Example

removeChars( "Hello BL World", 6, 5 );

Result: Hello World

Additional Examples

Run Example

writeDump( removeChars( "Hi buddy!, Have a nice day.", 10, 18 ) ); // Expected output: Hi buddy!
// Member function
str = "I love Boxlang";
writeDump( str.removeChars( 1, 7 ) );
 // Expected output: Boxlang

Last updated

Was this helpful?