I am a Java student in high school and I would like to know how to find the position of a certain character of group of characters no matter the length..
For example, if I am asking a user for a input via:
java.util.Scanner;
and they were asked to enter a date (mm/dd/yy) and usually I would do:
date.substring(0,2);
to get months but I learned this phrase my CS teacher "Users are dumb" so If they entered the date format in 1/3/2019 then the position of the month is different so how can i use something that looks for the month, day, or year despite the incorrect use of the date format?