Seperate Strings
Write a function void separate (string S), that fix the spacing problem in a string S. The function must print a given string S with a space before each capital letter in string S (except the first word). In addition, the function must count and display the number of words in the string S.
For example:
String S
output
HelloThere,ILoveC++.
Hello There, I Love C++.
Number of words is: 5
Note: ‘A’ ASCII value 65, ‘Z’ ASCII value 90, ‘a’ ASCII value 97 and ‘z’ ASCII value 122.
Seperate Strings
Write a function void separate (string S), that fix the spacing problem in a string S. The function must print a given string S with a space before each capital letter in string S (except the first word). In addition, the function must count and display the number of words in the string S.
For example:
String S
output
HelloThere,ILoveC++.
Hello There, I Love C++.
Number of words is: 5
Note: ‘A’ ASCII value 65, ‘Z’ ASCII value 90, ‘a’ ASCII value 97 and ‘z’ ASCII value 122.
Use the order calculator below and get started! Contact our live support team for any assistance or inquiry.
[order_calculator]
