Hi guys, I am having some problems. I have this char* : "this is bob.[aaa]", what I need is deleting everything after the first "[".
So it will be: "this is bob.".
I tried searching on google but I just found about std::string.. Thanks in advance for your help :)
If it's a normal C string (terminated by a null character), then you can just write a null character after the first '[' You can use strchr() to find the '['
1 2
char *cp = strchr(str_val, '[');
if (cp) cp[1] = 0;