Find the output (do the necessary working in your copy and write only the answer / output):
String s="Java 5.1";
String r="";
for(int i=s.length()-1; i>=0; i-=2)
{
char ch=s.charAt(i);
if(Character.isDigit(ch)) ch='*';
else if(Character.isLowerCase(ch)) ch++;
r=ch+r;
}
System.out.println(r);
Answers
Answered by
0
public class LengthExample2 {
public static void main(String[] args) {
String str = "Javatpoint";
if(str.length()>0) {
System.out.println("String is not empty and length is: "+str.length());
}
str = "";
if(str.length()==0) {
System.out.println("String is empty now: "+str.length());
}
}
}
JavaScript string arc..
Similar questions