Skip to content

string_delete

CryoEagle edited this page Dec 26, 2018 · 5 revisions

string_delete

Returns a copy of a given string with a selected section deleted.

Syntax:

string_delete(str, index, count)
Argument Description
string str The string to copy and delete from
int index The position of the first character to remove
int count (Optional) The number of characters to remove

Returns: string

Description

You can use this function to remove a specific part of a string. So, you supply the input string and the start and end position within that string to remove characters (index starts at 1) and the function will return a new string without that section in it. The count parameter is optional, without it, it will only remove the index position character.

Example:

string str1 = "Helloo World";
string str2 = string_delete(str1, 5, 1); 

This will set str2 to "Hello World", as it removes the extra "o" from "Hello", ie: the string counts along from the first letter 5 places, then deletes 1 character).

Back to strings

Clone this wiki locally