Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class AltifLiad {
  3.  
  4.     public static void main(String[] args) {
  5.         String str="Liad Altif";
  6.         System.out.println(NoCapsStr(str));
  7.     }
  8.     public static int NoCapsStr(String str)
  9.     {
  10.         if (str.length()==0)
  11.             return 0;
  12.        
  13.         if (str.charAt(str.length()-1)>='a'&&str.charAt(str.length()-1)<='z')
  14.             return NoCapsStr(str.substring(0,str.length()-1))+1;
  15.        
  16.         return NoCapsStr(str.substring(0,str.length()-1))+ 0;
  17.        
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement