InterviewSolution
Saved Bookmarks
| 1. |
String Functions |
Answer»
string lastName = "Babu"; string fullName = firstName.append(lastName); cout << fullName; This function concatenates one string after another string. The output of the above code will be: Ramesh Babu You can also change any individual character of a string in C++. string variable1 = "Hello World";variable1[1] = 'i'; cout << variable1;
cout << "The length of the string is: " << variable1.length(); It returns the length of the string as an integer. |
|