cpp/string/basic string/empty: Różnice pomiędzy wersjami
Z cppreference.com
< cpp | string/basic string
m (r2.7.3) (Robot dodał en, ja, pt, ru, zh) |
m (r2.7.3) (Robot dodał de, es, fr, it) |
||
Linia 31: | Linia 31: | ||
Powiązane tematy: [[cpp/string/basic_string/size | size]] | Powiązane tematy: [[cpp/string/basic_string/size | size]] | ||
+ | |||
[[en:cpp/string/basic string/empty]] | [[en:cpp/string/basic string/empty]] | ||
+ | |||
+ | |||
+ | |||
[[ja:cpp/string/basic string/empty]] | [[ja:cpp/string/basic string/empty]] | ||
[[pt:cpp/string/basic string/empty]] | [[pt:cpp/string/basic string/empty]] | ||
[[ru:cpp/string/basic string/empty]] | [[ru:cpp/string/basic string/empty]] | ||
[[zh:cpp/string/basic string/empty]] | [[zh:cpp/string/basic string/empty]] |
Aktualna wersja na dzień 11:52, 2 lis 2012
Składnia:
#include <string> bool empty() const;
Metoda **empty()** zwraca TRUE, jeśli string nie zawiera znaków, FALSE w przeciwnym wypadku.
Na przykład:
string s1; string s2(""); string s3("To jest string"); cout.setf(ios::boolalpha); cout << s1.empty() << endl; cout << s2.empty() << endl; cout << s3.empty() << endl;
Kod wyświetli:
true true false
Powiązane tematy: size