sources/mystring.h

changeset 107
ca10837a2a9e
parent 105
b4466472aecd
child 108
5900be70c619
child 109
e4966d7e615d
--- a/sources/mystring.h	Sat Jan 09 17:20:25 2016 +0200
+++ b/sources/mystring.h	Sat Jan 09 17:48:28 2016 +0200
@@ -100,6 +100,7 @@
 	void insert (int pos, const char*c) { m_string.insert (pos, c); }
 	void modify_index (int &a) { if (a < 0) { a = length() - a; } }
 	void normalize (int (*filter)(int) = &isspace);
+	String normalized (int (*filter)(int) = &isspace) const;
 	void prepend (String a) { m_string = (a + m_string).std_string(); }
 	void remove (int pos, int len) { m_string.replace (pos, len, ""); }
 	void remove_at (int pos) { m_string.erase (m_string.begin() + pos); }
@@ -110,8 +111,9 @@
 	void shrink_to_fit() { m_string.shrink_to_fit(); }
 	void __cdecl sprintf (const char* fmtstr, ...);
 	void vsprintf (const char* fmtstr, va_list args);
-	bool starts_with (const String &other);
-	String strip (const List<char>& unwanted);
+	bool starts_with (const String &other) const;
+	String strip (char unwanted) { return strip ({unwanted}); }
+	String strip (const List<char> &unwanted);
 	void trim (int n);
 
 	static String from_number (short int a);

mercurial