Basically, I want to check if a string (main) starts with another string (sub), using both of the above methods. For example, following is my code:
main
sub