I'm currently doing this task. In the first part of the task it required me to check a string with boolean. For it to return true and only true only if every character of the input string is one of a, A, c, C, g, G, t or T. Return false if the string is null or empty. I'm a bit lost at this because i'm not sure how to compare it. I'm looking at using array and checking with the for loop for the string. Is it a feasible option? If not are there any other options i should look at?
This is my code so far. I put the string s to lower case to make the comparing easier with only 4 characters to do so.
public static boolean isDNASequence(String s) {
boolean isDNASequnce = false;
char [] acceptableInput = {'a', 'c', 'g', 't'};
String x = s.toLowerCase();
I'm a very big java noob so please excuse me if i don't know my way around here :D