📜  如何在 C++ 代码示例中获取字符串长度

📅  最后修改于: 2022-03-11 14:44:55.994000             🧑  作者: Mango

代码示例2
#include 
using namespace std;
int main() {
    string str = "Viet Nam";
    cout << "String Length = " << str.size();
      // you can also use str.length()
    return 0;
}