Sort an array of strings

Kopal Jaiswal
16 Posts

WAP to sort an array of strings based on ascending number of characters in each string. If two words have same length then sort them by 

Example1:

Input:

Array[]={"this", "is", "a" , "learning", "portal"}

Output:

a is this portal learning

Published By : Kopal Jaiswal
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Comments