Heres an example of why im so mad at this
so you have a string: [pizza] hut
okay so line 1 will find the position of "]" just fine
line 2 deletes "]" and everything after it just fine
line 3 is where my blood boils
THE MANUAL
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.
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 The number of characters to remove.
Example:
str1 = "Helloo World";
str2 = string_delete(str1, 5, 1);
That works all well and good because postion 5 and 6 are "o"
Back to my example
our string is [pizza
i want to remove "["
its the first charecter, pos 1
so you should just be able to
because [ is in the first position, index counts from 1, so it should be 1
no, you get [pizza
but using 2
works, but [ is not the second character, its the first
So what is the first character of a string? an invisible space?
to add more context
str1 = "Helloo World";
str2 = string_delete(str1, 5, 1);
Helloo World
its deleting the 6th charecter not the 5th even though in code you said delete the 5th one
so you have a string: [pizza] hut
Code:
1. end_pos = string_pos("]", my_arguments);
2. print_string = string_delete(my_arguments,(end_pos),( (string_length(my_arguments)) ));
3. print_string = string_delete(print_string,2,1);
4. show_message(print_string);
line 2 deletes "]" and everything after it just fine
line 3 is where my blood boils
THE MANUAL
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.
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 The number of characters to remove.
Example:
str1 = "Helloo World";
str2 = string_delete(str1, 5, 1);
That works all well and good because postion 5 and 6 are "o"
Back to my example
our string is [pizza
i want to remove "["
its the first charecter, pos 1
so you should just be able to
Code:
print_string = string_delete(print_string,1,1);
no, you get [pizza
but using 2
Code:
print_string = string_delete(print_string,2,1);
So what is the first character of a string? an invisible space?
to add more context
str1 = "Helloo World";
str2 = string_delete(str1, 5, 1);
Helloo World
its deleting the 6th charecter not the 5th even though in code you said delete the 5th one