String library.

Dependents:   CheckSum RN41 RealTimeClock TVZ_MU_Seminar ... more

Files at this revision

API Documentation at this revision

Comitter:
AkinoriHashimoto
Date:
Wed Sep 02 04:47:08 2015 +0000
Parent:
3:ad74ab63f78c
Child:
5:9afdff23f890
Commit message:
add strCompareComplete().

Changed in this revision

StrLib.cpp Show annotated file Show diff for this revision Revisions of this file
StrLib.h Show annotated file Show diff for this revision Revisions of this file
--- a/StrLib.cpp	Wed Sep 02 04:20:46 2015 +0000
+++ b/StrLib.cpp	Wed Sep 02 04:47:08 2015 +0000
@@ -80,6 +80,17 @@
         return false;
     return id == idx;
 }
+bool strCompareComplete(string trg, string cmp)
+{
+    int idx= trg.find(cmp);
+    if(idx == string::npos)
+        return false;
+    idx= cmp.find(trg);
+    if(idx == string::npos)
+        return false;
+    
+    return true;
+}
 
 string toAlpanumeric(string str, bool toLarge)
 {
--- a/StrLib.h	Wed Sep 02 04:20:46 2015 +0000
+++ b/StrLib.h	Wed Sep 02 04:47:08 2015 +0000
@@ -34,6 +34,8 @@
 */
 bool strCompare(string trg, string cmp, int idx);   // trg内にcmpが存在する位置がidxか判定。
 
+bool strCompareComplete(string trg, string cmp);
+
 /** Eraze others Alphameric, and convert lower-cases to capitals.
  *
  *  @param  string target, bool to-capitals.