shell cut string

Sample:
api-login-103923

to get the api

echo "api-login-103923"|cut -d"-" -f1

-d is the seprator
-f is the index , starting from 1