string_delete

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

Syntax:

GML Code Example

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 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.


Example:

GML Code 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: Strings



No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here