Monday, March 28, 2016

Reverse String Word by Word in Java ( Character array)

public class ReverseWords {
    public static void main(String[] args) {
        
        String data = "Me loves India";
        System.out.println(data);
        char arr[] = data.toCharArray();
       
        int l = 0;
        for (int i = arr.length - 1; i >= 0; i--) {
            l++;
            
             if (arr[i] == ' ' || i == 0) {
                if (i == 0) {
                    for (int j = i; j < i + l; j++)
                        System.out.print(arr[j]);
                } else {
                    for (int j = i + 1; j < i + l; j++)
                        System.out.print(arr[j]);
                    System.out.print(" ");
                }
                l = 0;
               }
        }

    }
}

Spring Boot 3 : JWT with SecurityFilterChain, AuthorizeHttpRequests, RequestMatchers

pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"...