You will need a regular expression, which is not supported by startsWith
:
^[a-zA-Z]:\\\\.*
^ ^ ^ ^
| | | |
| | | everything is accepted after the drive letter
| | the backslash (must be escaped in regex and in string itself)
| a letter between A-Z (upper and lowercase)
start of the line
Then you can use yourString.matches("^[a-zA-Z]:\\\\")