I wanna build a function that will check a string whether it's valid format.
Input is like that:
String str1 = "Chapter 1: Home"
String str2 = "Chapter 2: Revenge"
String str3 = "Chapter 3c: Return"
The function will return true, if string is formated as "Chapter" + [a space] + [number] + ":" and return false if it's not
Output:
True
True
False
Edit: Thank you so much for your quick responds I have realized that Regex is the main point.