My Project
Loading...
Searching...
No Matches
Functions
Utility Namespace Reference

many function can be global actually More...

Functions

bool isSubstring (string sub, string s)
 Check whether sub is the substring of s.
 
int substringFirstIndex (string sub, string s)
 find the index of sub in string s
 
string fun_parent_parent ()
 
void cut (char *pt)
 
int stringToInt (string s)
 
double stringToDouble (std::string s)
 
long stringToLong (std::string s)
 
float stringToFloat (std::string s)
 
string charToString (char ch)
 
void begin ()
 
void begin (const char *name)
 
void end ()
 
string fun_parent ()
 
void print (Vector3 v)
 
void print (DDLinkedList< Vector3 > *ddl)
 

Detailed Description

many function can be global actually

Function Documentation

◆ isSubstring()

bool Utility::isSubstring ( string  sub,
string  s 
)

Check whether sub is the substring of s.

bool b = isSubstring("", "") => true
bool b = isSubstring("", "a") => true
bool b = isSubstring("bc", "abc") => true
bool isSubstring(string sub, string s)
Check whether sub is the substring of s.
Definition: AronLib.h:2825
bool b = isSubstring("", "") => true
bool b = isSubstring("", "a") => true
bool b = isSubstring("bc", "abc") => true

◆ substringFirstIndex()

int Utility::substringFirstIndex ( string  sub,
string  s 
)

find the index of sub in string s

  • If sub is empty, then return -1
  • If found sub is the sub of s, then return the first index in s
substringFirstIndex("", "a") => -1
substringFirstIndex("a", "ba") => 1
int substringFirstIndex(string sub, string s)
find the index of sub in string s
Definition: AronLib.h:2864