Xojo StringUtils Harness API2

Xojo StringUtils Harness API2

Joe Strout wrote ages ago a toolset for string manipulations beyond Xojo’s out-of-the-box functionality: http://www.strout.net/info/coding/rb/.

I converted this plugin to Xojo API2, available below:

I included the original version for two reasons:

  • Ensuring it won’t get lost

  • And for users who want, for education purposes to convert the original project themselves to API2.

As Joe’s original project contains unit tests, it is a fanastic way to learn (and check) the pitfalls of any conversion to API2. Most of it is a diligent but routine piece of work. However, as a few string manipulator (like string.Middle(x,y) in comparison to Mid(string, x, y) are now finally(!) 0-based and not longer 1-based a particular attention has to be spent on such kind of conversions.

Of course some methods could be renamed as the original command has be renamed as well in Xojo API2, but this was not part of this original version (as well to maintain easier backwards compatibility to older code). This can be added in future releases.

The available methods are:

Disclaimer: As the original toolset this version is, of course, released as public domain. Though most people will just include it in their own workflows (and make adaptions where needed) a contribution on github is highly appreciated in case of any bugs one might find. I don’t have use for all methods. I checked the unit tests, which are all working, but this alone might not yet be a guarantee that the methods are all bug-free.

Did you find this article valuable?

Support Jeannot Muller by becoming a sponsor. Any amount is appreciated!