Advertisement
X-88

detectupcaseafterspace

Nov 17th, 2021
1,034
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. string s = "Zephio - test deteksi huruf Kapital setelah Space dalam Kata-Kata. lang: C++     fho    t tT V zcvk W ccXjkp        ";
  6. int i, l = s.length();
  7.  
  8. void ztest()
  9. {
  10.    cout << "Original String:\n "  << s << "\n==================================" << endl;
  11.     i = 0;
  12. while(i < l)
  13. {
  14. if(
  15.   (int(char(s[i])) >= 65) &&    (int(char(s[i])) <= 97) && (char(s[i - 1]) == char(0x20))
  16.   )
  17.     cout << "[√], Pos: " << i << ", IntChar: " << int(char(s[i])) << " [" << char(s[i]) << "]" << endl;
  18. else
  19.    cout << "[x], Pos: " << i << ", IntChar: " << int(char(s[i])) << " [" << char(s[i]) <<"]"<< endl;
  20.     i++;
  21. }
  22.  
  23. }
  24.  
  25. int main()
  26. {
  27.     ztest();
  28.     return 0;
  29. }
Advertisement
RAW Paste Data Copied
Advertisement