04-19-2025, 05:23 PM
(This post was last modified: 04-19-2025, 05:26 PM by hsiangch_ong.)
@mdijkens
if you have programmed for as long as you say. (not only someone in basic, because this topic could apply to any programming language. especially a language that is good at text processing.) you would make sure you use your really-fast routine. while the replace string is not included in the search string. the user would have to use the very slow routine only for that case. your really-fast routine for other cases.
what if i had a large text which only had "van gogh". but not the name of that person. which van gogh? ok so it's vincent? change every occurrence of "van gogh" with "vincent van gogh". that is the trouble i was trying to indicate.
edit: now i notice above that the length of the replacement was being accounted for in your version. the slower of the two. that is crucial. but i did say my version was flawed. into assuming to temporarily replace with a string that nobody desired as a valid value.
if you have programmed for as long as you say. (not only someone in basic, because this topic could apply to any programming language. especially a language that is good at text processing.) you would make sure you use your really-fast routine. while the replace string is not included in the search string. the user would have to use the very slow routine only for that case. your really-fast routine for other cases.
what if i had a large text which only had "van gogh". but not the name of that person. which van gogh? ok so it's vincent? change every occurrence of "van gogh" with "vincent van gogh". that is the trouble i was trying to indicate.
edit: now i notice above that the length of the replacement was being accounted for in your version. the slower of the two. that is crucial. but i did say my version was flawed. into assuming to temporarily replace with a string that nobody desired as a valid value.