Possible modifications to string class CString #479
SteveSpencer
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Good idea. Yes, please send a PR for these new methods. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Would there be any interest in making some changes to the CString class?
Adding:
const char* c_str()
Performs the same function as explicit cast to const char*.
In my head, this is clearer than a cast, as str.c_str() is a familiar idiom to developers who have used std::string
void Append(const char ch)
Would be useful when creating strings from sub-strings of other strings.
CString& operator += (const char ch)
CString& operator += (const char* str)
CString& operator += (const CString& str)
Again, would be useful building CString objects
As most of the functionality already exists, there would be minimal overhead in adding these, and existing code would still recompile cleanly.
I would be happy to submit a PR to do this.
Beta Was this translation helpful? Give feedback.
All reactions