Code:
new string1[]= "AA=hi,BB=hello,CC=hey,DD=sup,EE=anotherhi"
new string2[10]
find_value(string1, "CC", string2, 9)
find_value(in_string[], _for[], value[], outlen) {
new len = strlen(in_string), len2 = strlen(_for)
new pos, templen
while ( pos != len - len2 ) {
if ( equal(in_string[pos], _for, len2) ) {
pos += len2 + 1
while ( in_string[pos] != ',' && templen < outlen && pos < len ) {
value[templen] = in_string[pos]
templen++
pos++
}
break
}
pos++
}
}