-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsentenceCleaner.java
39 lines (37 loc) · 1.04 KB
/
sentenceCleaner.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package KserOS;
import java.util.*;
class sentenceCleaner
{
void main(int pass,int uc)
{
User aps= new User();
byte asd=0;
do
{
System.out.print('\u000C');
Scanner a=new Scanner(System.in);
String a2="";
char z=' ';
asd=0;
System.out.print("Enter the sentence you want to clean: ");
String a1=a.nextLine();
for(int lp=0;lp<a1.length();lp++)
{
z=a1.charAt(lp);
if(Character.isLetter(z)||z==' ')
{
a2=a2+z;
}
}
System.out.println("Your Cleaned sentence is: "+a2);
System.out.println("Do you want to leave the program?\nIf yes type \"Y\" or else type anything");
String ans=a.next();
System.out.print("\f");
if(ans.equalsIgnoreCase("Y"))
{
aps.DoNotRun(pass,uc);
asd++;
}
}while(asd<1);
}
}