Answer:
public static String onlyDigits(String in){
String digitsOnly = in.replaceAll("[^0-9]", "");
return digitsOnly;
}
A Complete program is wrtten in the explanation section
Explanation:
public class TestClass {
public static void main(String[] args) {
String a = "-jaskdh2367sd.27askjdfh23";
System.out.println(onlyDigits(a));
}
public static String onlyDigits(String in){
String digitsOnly = in.replaceAll("[^0-9]", "");
return digitsOnly;
}
}
The output: 23672723
The main logic here is using the Java replaceAll method which returns a string after replacing all the sequence of characters that match its argument, regex with an empty string
Answer:
Facility
Explanation:
This is the answer because you can spell it out with Horizon.
Answer:
I think the answer is C
Explanation:
Because if you use context clues for the word CINEMATOGRAPHER, cinema is like scene and lights and tographer is the person who adjusts it
int counter = 0;
int num = 0;
string output = "";
while (counter < 3) {
num = num * 1;
counter = counter + 1; }
output = Convert.ToString(num);
Output:
Counter = 0
num = 0 * 1 - - > num = 0
Counter = 1
num = 0 * 1 - - > num = 0
Counter = 2
num = 0 * 1 - - > num = 0
Counter = 3 (break)
num = 0
output = "0"