Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
StringUtil.cpp@0:28fdf43083f9, 2018-04-29 (annotated)
- Committer:
- tichise
- Date:
- Sun Apr 29 04:50:06 2018 +0000
- Revision:
- 0:28fdf43083f9
- Child:
- 1:5a7b4310d67c
????
Who changed what in which revision?
| User | Revision | Line number | New 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 | } |