takuya ichise / StringUtil
Committer:
tichise
Date:
Sun Apr 29 04:50:06 2018 +0000
Revision:
0:28fdf43083f9
Child:
1:5a7b4310d67c
????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tichise 0:28fdf43083f9 1 #include "StringUtil.h"
tichise 0:28fdf43083f9 2 #include "mbed.h"
tichise 0:28fdf43083f9 3
tichise 0:28fdf43083f9 4 StringUtil::StringUtil() {
tichise 0:28fdf43083f9 5 }
tichise 0:28fdf43083f9 6
tichise 0:28fdf43083f9 7 // 文字列strからstart_strとend_strで囲まれた部分を抽出する。
tichise 0:28fdf43083f9 8 string StringUtil::matchSlice(string str, string startStr, string endStr)
tichise 0:28fdf43083f9 9 {
tichise 0:28fdf43083f9 10 int startPos = str.find(startStr);
tichise 0:28fdf43083f9 11 int endPos = str.rfind(endStr);
tichise 0:28fdf43083f9 12 return str.substr(startPos + 1, endPos - startPos - 1);
tichise 0:28fdf43083f9 13 }