Guest User

Untitled

a guest
Aug 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. Use of an iterator when comparing two wstring
  2. wcscmp(*n,*k);
  3.  
  4. std::wstring n = L"Hello you little fello";
  5. std::wstring k = L"little";
  6.  
  7. if ( n.find(k) != wstring::npos )
  8. {
  9. ...
  10. }
  11.  
  12. wcscmp(n->c_str(), k->c_str());
  13.  
  14. wstring lowN(*n);
  15. wstring lowK(*k);
  16.  
  17. std::transform(lowN.begin(), lowN.end(), lowN.begin(), ::tolower);
  18. std::transform(lowK.begin(), lowK.end(), lowK.begin(), ::tolower);
  19.  
  20. if ( wstring::npos != lowN->find(lowK) ) {
  21. // n contains k
  22. }
  23.  
  24. n->find(*k);
  25.  
  26. wcscmp(n->c_str(),k->c_str());
Add Comment
Please, Sign In to add comment