overload str_mid so it has the same semantics as Python's slice operator

This is an imperfect revision of history.
This commit is contained in:
Bill Currie 2004-11-14 00:53:00 +00:00 committed by Jeff Teunissen
parent 4a7e2ff093
commit 96e20d891c
2 changed files with 6 additions and 0 deletions

View file

@ -15,5 +15,8 @@
@extern string (string str) str_free;
@extern string (string dst, string src) str_copy;
@extern string (string str) str_clear;
@extern string (string str, integer start) @overload str_mid;
@extern string (string str, integer start, integer len) @overload str_mid;
@extern string (string haystack, string needle) str_str;
#endif//__ruamoko_string_h

View file

@ -14,3 +14,6 @@ string (void) str_new = #0;
string (string str) str_free = #0;
string (string dst, string src) str_copy = #0;
string (string str) str_clear = #0;
string (string str, integer start) str_mid = #0;
string (string str, integer start, integer len) str_mid = #0;
string (string haystack, string needle) str_str = #0;