Generation

generate functionSat, 12 Nov 2022

trim whitespace from a string

string trim(string s) { while (s.back() == ' ' || s.back() == '\t' || s.back() == '\n') { s.pop_back(); } while (s.front() == ' ' || s.front() == '\t' || s.front() == '\n') { s.erase(0,1); } return s; }

Want to kickstart your project?Use the new AI Studio to create your code