diff --git a/README.md b/README.md index 2000c36..a14d743 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ -# amscpptemplate25a +# amsstring4 + +std::strings are awkward. Also, you can never trust the standard library. std::vector anyone? + +This is a mutable ASCII/UTF-8 string class with every convenience feature I can think of added in, portability shims for MSVC, and support for converting to/from unicode codepoints. + +Depends on amsarrays from amsmathutil25 for handling arrays of strings. -Rearrange my C++ project template in an attempt to harmonize everything and modernize my build scripts. \ No newline at end of file diff --git a/build_linux64/libamsstring4.linux64.a b/build_linux64/libamsstring4.linux64.a index d510542..b3f7698 100644 Binary files a/build_linux64/libamsstring4.linux64.a and b/build_linux64/libamsstring4.linux64.a differ diff --git a/build_linux64/objstore/amsstring4_convenience1.o b/build_linux64/objstore/amsstring4_convenience1.o index f52bfc1..06818fb 100644 Binary files a/build_linux64/objstore/amsstring4_convenience1.o and b/build_linux64/objstore/amsstring4_convenience1.o differ diff --git a/build_linux64/tests b/build_linux64/tests index d53356e..eadb4dd 100644 Binary files a/build_linux64/tests and b/build_linux64/tests differ diff --git a/include/amsstring4/amsstring4.hpp b/include/amsstring4/amsstring4.hpp index f495d32..7c6e1ec 100644 --- a/include/amsstring4/amsstring4.hpp +++ b/include/amsstring4/amsstring4.hpp @@ -174,6 +174,10 @@ amsarray splitwhitespace(const amsstring &s); amsstring stripwhitespace(const amsstring &s); amsstring stripallwhitespace(const amsstring &s); +//splits a string into contiguous sets of alphanumeric characters ignoring non-alphanums +amsarray splitalphanum(const amsstring &s); // + + //splits into two guaranteed pieces //if an extension separator . is not encountered, the first piece will contain the entire string, the second "" amsarray splitext(const amsstring &s); diff --git a/src/amsstring4/amsstring4_convenience1.cpp b/src/amsstring4/amsstring4_convenience1.cpp index efb473a..651c703 100644 --- a/src/amsstring4/amsstring4_convenience1.cpp +++ b/src/amsstring4/amsstring4_convenience1.cpp @@ -379,8 +379,8 @@ amsarray splitpath(const amsstring &s) ret.resize(2); int ind1,ind2; - ind1 = s.find('/'); - ind2 = s.find('\\'); + ind1 = s.findright('/'); + ind2 = s.findright('\\'); if(ind1>=0) { if(ind1==0)