String library.
Dependents: CheckSum RN41 RealTimeClock TVZ_MU_Seminar ... more
StrLib.h@1:7c89cd414311, 2015-06-29 (annotated)
- Committer:
- AkinoriHashimoto
- Date:
- Mon Jun 29 01:51:12 2015 +0000
- Revision:
- 1:7c89cd414311
- Parent:
- 0:058192932ad2
- Child:
- 2:14f3ff21096e
my string library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AkinoriHashimoto | 0:058192932ad2 | 1 | #pragma once |
AkinoriHashimoto | 0:058192932ad2 | 2 | |
AkinoriHashimoto | 0:058192932ad2 | 3 | #include "mbed.h" |
AkinoriHashimoto | 0:058192932ad2 | 4 | #include <string> |
AkinoriHashimoto | 1:7c89cd414311 | 5 | |
AkinoriHashimoto | 0:058192932ad2 | 6 | |
AkinoriHashimoto | 1:7c89cd414311 | 7 | /** String(Ascii) -> long(int) |
AkinoriHashimoto | 0:058192932ad2 | 8 | * @param string target(str), int Base(8Oct, 10Dec, 16Hex) |
AkinoriHashimoto | 0:058192932ad2 | 9 | * @return long int |
AkinoriHashimoto | 0:058192932ad2 | 10 | */ |
AkinoriHashimoto | 1:7c89cd414311 | 11 | long A2I(string, int); |
AkinoriHashimoto | 0:058192932ad2 | 12 | |
AkinoriHashimoto | 0:058192932ad2 | 13 | /** int -> string |
AkinoriHashimoto | 0:058192932ad2 | 14 | * @param int target(num), int Base(8Oct, 10Dec, 16Hex), int Number of digit |
AkinoriHashimoto | 0:058192932ad2 | 15 | * @return string str |
AkinoriHashimoto | 0:058192932ad2 | 16 | */ |
AkinoriHashimoto | 1:7c89cd414311 | 17 | string I2A(int num, int base= 10, int digitNum= 0); |
AkinoriHashimoto | 0:058192932ad2 | 18 | |
AkinoriHashimoto | 0:058192932ad2 | 19 | /** string Compare |
AkinoriHashimoto | 0:058192932ad2 | 20 | * @param string target, string cmp, int index in target |
AkinoriHashimoto | 0:058192932ad2 | 21 | * @return bool |
AkinoriHashimoto | 0:058192932ad2 | 22 | */ |
AkinoriHashimoto | 0:058192932ad2 | 23 | bool strCompare(string trg, string cmp, int idx); // trg内にcmpが存在する位置がidxか判定。 |
AkinoriHashimoto | 1:7c89cd414311 | 24 | |
AkinoriHashimoto | 1:7c89cd414311 | 25 | |
AkinoriHashimoto | 1:7c89cd414311 | 26 | string toAlpanumeric(string str, bool large=false); |