Question: (FOR JAVA) Assuming s is a variable referring a string, n is an int variable, write a for loop to find the number of spaces
(FOR JAVA)
Assuming s is a variable referring a string, n is an int variable, write a for loop to find the number of spaces in s, set that to n. For example, if s refers the string "a b ", then n would be 3; if the string is "ab", then n would be 0
No need to write a program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
