arekowczarek Posted November 25, 2010 Report Share Posted November 25, 2010 I am having a problem splitting a string into two other strings. I found that if we have a short input string looking like this: "a.b" and we wanna split it at "." , "b" will not get saved. If we change the "b" to "bc" in the input string, it will work just fine, saving "a" to one string, and "bc" to another. Can anyone confirm before I report it? Quote Link to comment Share on other sites More sharing options...
paul Posted November 25, 2010 Report Share Posted November 25, 2010 I am having a problem splitting a string into two other strings. I found that if we have a short input string looking like this: "a.b" and we wanna split it at "." , "b" will not get saved. If we change the "b" to "bc" in the input string, it will work just fine, saving "a" to one string, and "bc" to another. Can anyone confirm before I report it? Agreed. It's exactly the sort of sloppy programming I'd have expected (not properly testing fringe conditions), so it's disappointing that I'm not disappointed! Quote Link to comment Share on other sites More sharing options...
arekowczarek Posted November 25, 2010 Author Report Share Posted November 25, 2010 (edited) Agreed. It's exactly the sort of sloppy programming I'd have expected (not properly testing fringe conditions), so it's disappointing that I'm not disappointed! Thanks Paul, reporting now. If anyone needs a quick work-around here's one: 1. Append " " <space> to the input string before splitting 2. Split string 3. Right trim the last* sub-string created from splitting *If your input string looks like this "a.b.c.d", you only have to worry about "d" This issue has been assigned the tracking number [iSS9261] Edited November 29, 2010 by arekowczarek Quote Link to comment Share on other sites More sharing options...
Cory Posted December 1, 2010 Report Share Posted December 1, 2010 YIKES! I did some tests and it appears that this will happen regardless of the size of the input string as long as the last chunk is a single character. Wow, this can cause some serious problems for me. I might need to revert to be safe. I believe this is the result of recent work they have been doing to improve performance with arrays. I tried 4.1.6 and the problem isn't there. I can't find a copy of 4.1.7, does anyone still have it to confirm? Quote Link to comment Share on other sites More sharing options...
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.