String manipulation library
Diff: StringUtil.cpp
- Revision:
- 0:28fdf43083f9
- Child:
- 1:5a7b4310d67c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/StringUtil.cpp Sun Apr 29 04:50:06 2018 +0000 @@ -0,0 +1,13 @@ +#include "StringUtil.h" +#include "mbed.h" + +StringUtil::StringUtil() { +} + +// 文字列strからstart_strとend_strで囲まれた部分を抽出する。 +string StringUtil::matchSlice(string str, string startStr, string endStr) +{ + int startPos = str.find(startStr); + int endPos = str.rfind(endStr); + return str.substr(startPos + 1, endPos - startPos - 1); +} \ No newline at end of file