   are there better way to detect string?
  string name = "skin_arth";if(name[0] == 's' && name[1] =='k' && name[2] == 'i' && name[3] == 'n') //other stuffhow to detect the string contain "skin" character?   
  You can use the find() member function for strings(and others?) which returns the position number where it found the "skin".ie.if(name.find("skin") != string::npos)   ;  If "string" is the standard C++ lib string class you can just use the "find" method:if (name.find("skin") == 0) {    // skin Found at start.}The find() method has various overloaded versions but the version used above takes the substring to find as the first argument ("skin" in this case) and an offset to start looking in the string from (which defaults to 0 - the beginning of the string - if not specifically set as above). It returns the index of the first occurance of the substring in the main string or npos if the substring was not found - That is why an if statement is used to check that the substring "skin" was found at the start of the main string (at offset 0) and not either somewhere else in the string or not at all.Hope this helps,Mike.   ;  Like this:#include <iostream>#include <string>int main(){std::string a = "skin_something";std::string b = "something_skin";std::string c = "sk_in";std::cout << std::boolalpha;std::cout << "A contains skin: " << (a.find("skin") != std::string::npos) << std::endl;std::cout << "B contains skin: " << (b.find("skin") != std::string::npos) << std::endl;std::cout << "C contains skin: " << (c.find("skin") != std::string::npos) << std::endl;std::cout << "A starts with skin: " << (a.find("skin") == 0) << std::endl;std::cout << "B starts with skin: " << (b.find("skin") == 0) << std::endl;std::cout << "C starts with skin: " << (c.find("skin") == 0) << std::endl;std::cin.get();return 0;}boolalpha just make the == and != statements show up as true/false instead of 1/0.std::string::find returns the position of the first character of what we is searching for, if the string is not found it returns std::string::npos so in the first three tests we check if skin is in the string at all.In the next three tests we check if the position of the skin string is at the start of the string(pos = 0).EDIT: Too late   ;  [edit] Holy crap... 0 to 4 replies in 3 minutes, at 4:30 AM... [/edit]Assuming C++:string long = "This is a long string.";string short = "ng";cout << long.find(short) << endl;string::find() will return the index of the first match of "short" inside "long." If "short" does not occur in "long" at all, find() will return string::npos (the exact value for this is not defined, so always make sure to check for string::npos, and not any other value).See here and here for more information.   ;  Just to nitpick.  Using short and long as variable names would probably be a bad idea, since they are reserved words.   