lte5000 Posted August 26, 2006 Posted August 26, 2006 (edited) Expected results:$a = "abc" $a = StringReplace($a, "a", "") MsgBox(0, "contents of var $a", $a)Result of StringReplace() is "abc". I expected "bc".Bug? Intended behavior? I don't know.Thanks in advance for checking it out.Edit: added what I expected. Edited August 26, 2006 by lte5000
Developers Jos Posted August 26, 2006 Developers Posted August 26, 2006 (edited) Expected results: $a = "abc" $a = StringReplace($a, "a", "") MsgBox(0, "contents of var $a", $a)Result of StringReplace() is "abc". I expected "bc". Bug? Intended behavior? I don't know. Thanks in advance for checking it out. Edit: added what I expected. You forgot to mention why you expect only the first character to be replaced... The StringReplace() starts replacing at position 1 with the lenght of the replace string ..which is zero so nothing will happen... Edited August 26, 2006 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
lte5000 Posted August 26, 2006 Author Posted August 26, 2006 You forgot to mention why you expect only the first character to be replaced... I expected the first character (position 1) to be replaced with ""... because...well...just because. But after thinking it through, your explanation makes more sense. Thanks.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now