New course! Every coder should learn Generative AI!
Try a free lesson+ 1
I don't think there is any built-in function to do what you want, let alone a single line code. My idea was to check each character whether it was a digit using the `isdigit` function. You will for that matter, need to include <ctype.h> if you write C code, or include <cctype> if you write C++ code.
Reference:
http://www.cplusplus.com/reference/cctype/
P.S. Is this question in any way related to your other question about `isdigit` function?
https://www.sololearn.com/Discuss/1918801/?ref=app