what string function??
I have a string with this "<a href="www.somesite.com">Somesite</a>"
I can find where href starts.
Now what C string function can I use to go from the href through the FIRST occurance of ">"
So basically I'd like to find the next ">" in that string from "href" but not the one after the </a">" or any other trailing greater than signs.
something like that should do it.
while((c = getchar()) != EOF)
if(c == '>')
c == ' ';
there might be a function for it, but I'm not sure what it is.
Use strchr() to find a character in a string. If you have a pointer to the href, that counts as a string, so you can use strchr() to search from that location to the next '>'.
char url = "<a href=\"www.somesite.com\">Somesite</a>";
char *s, *p;
s = strstr(url, "href");
if(s != NULL)
p = strchr(s, '>');
if(p != NULL) *p = 0; /* or do whatever you want; this modifies the original string */
Call me biased, but I also like sscanf.