We can use variable substitution to split a string using a character as separator:
STRING="x@y"
FIRST="${STRING%@*}"
SECOND="${STRING#*@}"
echo $STRING
echo $FIRST
echo $SECOND
Result:
x@y
x
y
We can use variable substitution to split a string using a character as separator:
STRING="x@y"
FIRST="${STRING%@*}"
SECOND="${STRING#*@}"
echo $STRING
echo $FIRST
echo $SECOND
Result:
x@y
x
y
For further actions, you may consider blocking this person and/or reporting abuse
NexGen Infosoft -
Atahan C. -
Anadu Godwin -
Pavol Z. Kutaj -
Top comments (0)