Use arrays, see this example.
https://create.arduino.cc/projecthub/team-onyx/morse-code-translator-46e9b8?f=1