Last active
December 14, 2019 00:00
-
-
Save bartekpacia/5bebecd50aa95554e15268dd7f5c78f5 to your computer and use it in GitHub Desktop.
I...I just wanted to crop email. `address@domain.com` -> `address`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal disableDelayedExpansion | |
set "string=;Init., 12, email@domain.com" | |
setlocal enableDelayedExpansion | |
set ^"string=!string:, email/=^ | |
!^" | |
for /f delims^=^ eol^= %%A in ("!string!") do ( | |
endlocal | |
set "string=%%A" | |
goto :break | |
) | |
:break | |
set string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
copy-pasted from stackoverflow