WiFi.begin use only const char*

I use de Wifi.h lib for ESP32 and I use interface html form for get data and form only work String, and I need write the value of form html on WiFi.begin ssid, password , but the WiFi.begin only accept const char*. How can I convert String for the const char*?

const char* ssid = "networkname";
const char* password = "mynetwork";

void setup() {

WiFi.begin(ssid,password); }

1 Like

Read the String class documentation:

Always consult the documentation first.

Look up random nerd tutorials