Auto change Wifi name

I am trying trying to make my OTA wifi/hostname change based on the first 5 characters my Blynk token ID. I'm normal good about researching things like this but I'm kind of lost to what to search under. Any help would be appreciated.

For instance...

char blynk_token[34] = "d896cc88f5635da49464558672543d2c";

ArduinoOTA.setHostname("Test");

Would change the hostname to "Testd896c"

Thank you looks like that is exactly what I needed. For some reason your code is showing "Test" and only the first 3 characters of the ID. When I change the 8 to 10 it works correctly. I can't find a reference for what the 8 actually does. Not sure if changing that will create a problem in the future.

Yep tried that which is why I increased it and didn't just come back saying it doesn't work. Also why I added " for the missing one in "test%s . I am by no means a good at coding but do try. I don't understand why it needs to be increased 2 over the 8 digits that are needed. I really do appreciate your help and will keep researching. Thanks

Got it. That makes complete sense now. Thanks again!

Another option would be to put HostName up next to the token and fill it in at the same time:

// When you change the token, put the first five characters into the HostName
char blynk_token[34] = "d896cc88f5635da49464558672543d2c";
char HostName[] = "Testd896c";

  // Down in the code:
  ArduinoOTA.setHostname(HostName);