Skip to content

seff34/String-Parser-In-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

String Parser in C

String Parser in C Standart Libs.

API Functions

Timer Initalize

int8_t parser(char* input,const char* header,const char* start,const char* end,char* output );
Parameter Type Description
input char* Input Array
header char* Header of Array
start char* Parsing Starter
end char* Parsing Finisher
output char* Output Array

Example Code

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>

int main(int argc,char **argv)
{
    (void)argc;
    (void)argv;

    char demand[] = "[ DEMAND ]";
    char name[]   = "NAME=Demand_00$";
    char message[]= "MSG=%00000000000000000000#\\x06$";
    //Local Variable
    //char result[50] = { 0 };

    //Dynamic Variable
    char* result = (char*)calloc(50,sizeof(char));
    
    parser(demand,"[ DEMAND ]"," "," ",result);
    printf("Result : %s\n",result);

    parser(name,"NAME=","=","$",result);
    printf("Result : %s\n",result);

    parser(message,"MSG=","=","$",result);
    printf("Result : %s\n",result);

    free(result);

    return EXIT_SUCCESS;
}

Download Code

Clone Project

  git clone https://github.com/seff34/String-Parser

Releases

No releases published

Packages

No packages published

Languages