Skip to content

Instantly share code, notes, and snippets.

@bartekpacia
Last active December 14, 2019 00:00
Show Gist options
  • Save bartekpacia/5bebecd50aa95554e15268dd7f5c78f5 to your computer and use it in GitHub Desktop.
Save bartekpacia/5bebecd50aa95554e15268dd7f5c78f5 to your computer and use it in GitHub Desktop.
I...I just wanted to crop email. `address@domain.com` -> `address`
@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
@bartekpacia
Copy link
Author

copy-pasted from stackoverflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment