String manipulation library

StringUtil.cpp

Committer:
tichise
Date:
2018-04-29
Revision:
0:28fdf43083f9
Child:
1:5a7b4310d67c

File content as of revision 0:28fdf43083f9:

#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);
}