Description: |
Knowing a certain character combination that never occurs in string1 can help solving the exercise.
Lets say @@@ never occurs in string1 then we can use it as prefix for string1 and reformulate the
question to: Does string1 alter if we delete any occurrence of @@@+string2 within string1.
If string1 alters then if string1 start string2 then string 1 will alter otherwise not. |
Script: |
1. 2. 3. 4. 5. 6. 7.
|
SETLOCAL ENABLEDELAYEDEXPANSION
set s=@@@%string1%
if "%s%"=="!s:@@@%string2%=!" (
echo.string1 doesn`t begin with string2
) ELSE (
echo.string1 begins with string2
)
|
|