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@1:5a7b4310d67c, 2018-04-29 (annotated)
- Committer:
- tichise
- Date:
- Sun Apr 29 04:58:00 2018 +0000
- Revision:
- 1:5a7b4310d67c
- Parent:
- 0:28fdf43083f9
change method name
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 | 1:5a7b4310d67c | 7 | // 文字列textからstart_stringとend_stringで囲まれた部分を抽出する。 |
| tichise | 1:5a7b4310d67c | 8 | string StringUtil::slice(string text, string startString, string endString) |
| tichise | 0:28fdf43083f9 | 9 | { |
| tichise | 1:5a7b4310d67c | 10 | int startPosition = text.find(startString); |
| tichise | 1:5a7b4310d67c | 11 | int endPosition = text.rfind(endString); |
| tichise | 1:5a7b4310d67c | 12 | return text.substr(startPosition + 1, endPosition - endPosition - 1); |
| tichise | 0:28fdf43083f9 | 13 | } |