Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Remove extra spacing from string (argument)
- function string_remove_badspaces(str) {
- var badSpaceFront = string_char_at(str,1);;
- while badSpaceFront == " " {
- str = string_delete(str, 1, 1);
- badSpaceFront = string_char_at(str,1);
- }
- var badSpaceBack = string_char_at(str,string_length(str));;
- while badSpaceBack == " " {
- str = string_delete(str, string_length(str), 1);
- badSpaceBack = string_char_at(str,string_length(str));
- }
- var badSpaceRemainsPos = string_pos(" ", str);;
- while badSpaceRemainsPos != 0 {
- str = string_delete(str, badSpaceRemainsPos, 1);
- badSpaceRemainsPos = string_pos(" ", str);
- }
- return str;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement