Wednesday, 13 February 2013

replace function(replace multiple characters)


public class StringReplace {
    public static void main(String[] args) {
       
        String name = "0namratha.asher";
        if(name.startsWith("0"))
        {
            System.out.println("OMG PLZ COME "+name.replace('0', ' ').replace('.', ' '));
        }
       
    }

}

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...