Sunday, 22 July 2012

String in ascending order

String in ascending order

package com.demo;

public class StringAscending {
public static void main(String[] args) {
String[] names = {"namratha","anita","asher","heena","jagruthi"};
String str = "this is my new string";
char[] content = str.toCharArray();
java.util.Arrays.sort(content);
 String sorted = new String(content);
 System.out.println(content);
}

}

No comments:

Post a Comment

Pass a HashMap from Angular Client to Spring boot API

This example is for the case where fileData is very huge and in json format   let map = new Map<string, string>()      map.set(this.ge...