diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-07-24 08:32:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-24 08:32:42 +0200 |
commit | aa062c54fcdac6a17e38f3678c886779bce325f9 (patch) | |
tree | c578a84dd1fd8285a5250ebfe8907494b02ff5a1 /core/variant_call.cpp | |
parent | 3cbd4337ce5bd3d589cd96e1a371d417be781841 (diff) | |
parent | 080c0bb7fea824f231e8972fe1e7f82290a2f453 (diff) |
Merge pull request #25090 from Chaosus/string_count
Added String.count method
Diffstat (limited to 'core/variant_call.cpp')
-rw-r--r-- | core/variant_call.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/variant_call.cpp b/core/variant_call.cpp index b637e745af..377cc889b8 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -237,6 +237,8 @@ struct _VariantCall { VCALL_LOCALMEM1R(String, casecmp_to); VCALL_LOCALMEM1R(String, nocasecmp_to); VCALL_LOCALMEM0R(String, length); + VCALL_LOCALMEM3R(String, count); + VCALL_LOCALMEM3R(String, countn); VCALL_LOCALMEM2R(String, substr); VCALL_LOCALMEM2R(String, find); VCALL_LOCALMEM1R(String, find_last); @@ -1502,6 +1504,9 @@ void register_variant_methods() { ADDFUNC2R(STRING, INT, String, find, STRING, "what", INT, "from", varray(0)); + ADDFUNC3R(STRING, INT, String, count, STRING, "what", INT, "from", INT, "to", varray(0, 0)); + ADDFUNC3R(STRING, INT, String, countn, STRING, "what", INT, "from", INT, "to", varray(0, 0)); + ADDFUNC1R(STRING, INT, String, find_last, STRING, "what", varray()); ADDFUNC2R(STRING, INT, String, findn, STRING, "what", INT, "from", varray(0)); ADDFUNC2R(STRING, INT, String, rfind, STRING, "what", INT, "from", varray(-1)); |