Skip to content

string_delete

drewmccluskey edited this page Nov 28, 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
str The string to copy and delete from.
index The position of the first character to remove.
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:

str1 = "Helloo World";
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