String/ForceMatch.c
void stringAssign(String* s, char* data) {
    if (s->data) {
        free(s->data);
    }
    int len = 0;
    char* temp = data;
    while (*temp) {
        len++;
        temp++;
    }
    if (len == 0) {
        s->data = NULL;
        s->len = 0;
    } else {
        temp = data;
        s->len = len;
        s->data = (char*)malloc(sizeof(char) * (len + 1));
        for (int i = 0; i < len; i++, temp++) {
            s->data[i] = *temp;
        }
    }
}
/**
 * assign value to a string
 * @param s the pointer of string
 * @param data the value you want to assign
 */
assign value to a string
@param s the pointer of string
@param data the value you want to assign
assign value to a string @param s the pointer of string @param data the value you want to assign
void stringAssign(String* s, char* data) {
    if (s->data) {
        free(s->data);
    }
    int len = 0;
    char* temp = data;
    while (*temp) {
        len++;
        temp++;
    }
    if (len == 0) {
        s->data = NULL;
        s->len = 0;
    } else {
        temp = data;
        s->len = len;
        s->data = (char*)malloc(sizeof(char) * (len + 1));
        for (int i = 0; i < len; i++, temp++) {
            s->data[i] = *temp;
        }
    }
}
void stringAssign ( String * s , char * data ) { if ( s -> data ) { free ( s -> data ) ; } int len = 0 ; char * temp = data ; while ( * temp ) { len ++ ; temp ++ ; } if ( len == 0 ) { s -> data = NULL ; s -> len = 0 ; } else { temp = data ; s -> len = len ; s -> data = ( char * ) malloc ( sizeof ( char ) * ( len + 1 ) ) ; for ( int i = 0 ; i < len ; i ++ , temp ++ ) { s -> data [ i ] = * temp ; } } }
assign value to a string
 @param s the pointer of string
 @param data the value you want to assign
assign value to a string @param s the pointer of string @param data the value you want to assign