C:
- strlen()
int main() { const char* str = "I love coding."; printf("%d", strlen(str)); return 0; }
C++:
- str.length()
- str.size()
int main() { string str = "I love coding."; cout << str.length() << endl; cout << str.size() << endl; return 0; }
Java:
- str.length()
public static void main(String[] args) { String str = "I love coding."; System.out.println(str.length()); }
Python:
- len()
str = "I love coding." print(len(str))