[Implemented] PB constant for Replace/RemoveString()
[Implemented] PB constant for Replace/RemoveString()
The ReplaceString() and RemoveString() commands in the string library have PB constants defined for the non-default search mode to be used. They don't however have a constant for the default mode, nor is this value defined in the help file. The constant is needed to use the default search mode when a StartPosition is also specified with these commands.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PB constant for default mode used for Replace/RemoveStri
Try ReplaceString(sgMacFileString,sFind,sReplace,0,1)
Related to:
http://www.purebasic.fr/english/viewtop ... =4&t=43418
Related to:
http://www.purebasic.fr/english/viewtop ... =4&t=43418
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Addict
- Posts: 4779
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: PB constant for default mode used for Replace/RemoveStri
If this is the correct value for case sensitive search, then it will be a workaround ... but no satisfying solution.IdeasVacuum wrote:Try ReplaceString(sgMacFileString,sFind,sReplace,0,1)
The advantage of named constants is, that we do not have to deal with "magic numbers". That's the reason why a constant such as #PB_String_NoCase does exist. So it's a matter of course, that a named constant say #PB_String_Case will be of our advantage as well.
Regards, Little John
-
- Addict
- Posts: 1264
- Joined: Wed Feb 28, 2007 9:13 am
- Location: London
Re: PB constant for default mode used for Replace/RemoveStri
I agree. It's often puzzled me that there isn't a constant for this.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."