mystring=" 40" i = InStr(mystring, " ") Mid(mystring, i, Len(" "), "") In this example Mid should replace first space with nothing, effectively deleting it. But it does nothing. The last time function worked properly was in 6.0.7.
Also note that if you use symbol directly(CHR$(8205)) it does the job but it should work with simple double quotes as well.
Hello, Thank you for filing the bug. Please send us a sample document, as this makes it easier for us to verify the bug. I have set the bug's status to 'NEEDINFO', so please do change it back to 'UNCONFIRMED' once you have attached a document. (Please note that the attachment will be public, remove any sensitive information before attaching it.) How can I eliminate confidential data from a sample document? https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F Thank you tested with 4.1 and 6.3 version and result is empty string.
there was an issue with mid function, fixed in lo 6.1.4 [Bug 121325] 4-argument form of Mid() BASIC function broken in 6.x (worked in 5.x and OO) https://bugs.documentfoundation.org/show_bug.cgi?id=121325 i cannot confirm this with lo 6.1.4.1, see attached picture
Created attachment 147383 [details] mid replace string
(In reply to sunweb from comment #1) > Also note that if you use symbol directly(CHR$(8205)) it does the job but it > should work with simple double quotes as well. This confuses me. CHR$(8205) is U+200D ZERO WIDTH JOINER. I find no occurrence of that (usually invisible) character in your example code in comment 0 (but which may be due to it getting lost when you copied the example code into this issue?). Where exactly would you use CHR$(8205) in the example code, and how exactly would it change the behavior when executing the code.
Created attachment 147690 [details] Macros with example
(In reply to sunweb from comment #6) > Created attachment 147690 [details] > Macros with example The content of that short text/plain attachment is just "Macros attached in a file"?
Sorry, i thought i've uploaded ODS document with macros examples.
Created attachment 147734 [details] Macros inside this ODS file
(In reply to sunweb from comment #9) > Created attachment 147734 [details] > Macros inside this ODS file Ah, so the result of mystring=" 40" i = InStr(mystring, " ") Mid(mystring, i, Len(" "), CHR$(8205)) is a mystring of length 3, with a first invisible character U+200D ZERO WIDTH JOINER. The original issue from comment 0 is a duplicate of issue 121325, and should be fixed in LO 6.1.4, as confirmed in comment 3. *** This bug has been marked as a duplicate of bug 121325 ***