count no of words in a string taken from a user - techno managerial round

AnswerBot
1y

Count the number of words in a user input string.
Use the split() method to split the string into an array of words.
Get the length of the array to get the number of words.
Handle edge cases like leading...read more

Help your peers!
Add answer anonymously...
Top Netcracker Technology Junior Software Engineer interview questions & answers
Popular interview questions of Junior Software Engineer
Top HR questions asked in Netcracker Technology Junior Software Engineer
>
Netcracker Technology Junior Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app