Replace Vowel with Previous Letter

Given a string the task is to change all the vowels present in the string to the preceding letter.

Example: Consider the string “Lorem Ipsum is simply dummy text”. The program should output “Lnrdm Hpstm hs shmply dtmmy tdxt”. We observe that all the vowels in the original string are changed to previous letter.

Java
import java.util.*;
public class VowelReplacePrevious
{
    public static void main(String args[])
    {
        int l=0;
        char ch=' ';
        String str="",nstr="";
        Scanner sc=new Scanner(System.in);
        System.out.print("Enter the string: ");
        str=sc.nextLine();
        str=str.trim();
        str=str+" ";
        l=str.length();
        for(int i=0;i<l;i++)
        {
            ch=str.charAt(i);
            if(ch=='A'||ch=='a')
            {
                nstr=nstr+(char)((int)ch+25);
            }
            else if(ch=='E'||ch=='I'|| ch=='O'||ch=='U'||ch=='e'|| ch=='i'||ch=='o'||ch=='u')
            {
                nstr=nstr+(char)((int)ch-1);                               
            }
            else
            {
                nstr=nstr+ch;
            }
        }
        System.out.println("New string: "+nstr);
    }
}
Java