acamso 55 Posted May 26, 2017 Report Share Posted May 26, 2017 2 Quote Link to post Share on other sites
Varo 28 Posted May 27, 2017 Report Share Posted May 27, 2017 Thanks acamso, But with regex\s+you are matching whitespace character which is space, tab, newline, and carriage return with your function above, all newline and carriage return also will be replace with space right ?How to remove extra spaces only, in every line, without removing tab, newline, and carriage return ? Quote Link to post Share on other sites
PRO 69 Posted May 27, 2017 Report Share Posted May 27, 2017 What do you mean by "extra spaces"? Quote Link to post Share on other sites
Varo 28 Posted May 27, 2017 Report Share Posted May 27, 2017 What do you mean by "extra spaces"? leading spaces, trailing spaces, and space more than one between words. Quote Link to post Share on other sites
PRO 69 Posted May 27, 2017 Report Share Posted May 27, 2017 Basically you might want to use a "replace" function or command. You can search for plain text patterns like " " (double space) and replace it with a single space " " or even with "$nothing" to replace the found pattern with nothing. You could also use some RegEx Replace function, if it better suits your needs. You can execute multiple replace commands/functions in a sequence. Quote Link to post Share on other sites
PRO 69 Posted May 29, 2017 Report Share Posted May 29, 2017 There is a bot bank function called "Clean Text", this seems to do what you want to achieve: http://wiki.ubotstudio.com/wiki/Clean_Text You might also want to use "Trim" http://wiki.ubotstudio.com/wiki/Trim Cheers! Quote Link to post Share on other sites
acamso 55 Posted October 26, 2017 Author Report Share Posted October 26, 2017 Thanks acamso, But with regex\s+you are matching whitespace character which is space, tab, newline, and carriage return with your function above, all newline and carriage return also will be replace with space right ?How to remove extra spaces only, in every line, without removing tab, newline, and carriage return ? Yes this function is intended for a string without new lines. I'll make one with new lines included. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.