You could use: string.contains(“what to look for”). Example (js):
private var TestString = "as3klkfjslgtke5tkt";
function CheckCode ()
{
if (TestString.Contains("3k"))
{
Debug.Log("Code Correct");
//do whatever you need to do for 3k
}
}
EDIT: Alternative:
if (TestString.Contains("3") && (TestString.Contains("k"))
You could try a system where you use String.split on the string and look for a sequence of numbers or letters at certain places? Info here: String.Split Method (System) | Microsoft Learn
Have a look at all the methods available and see whats best.