You are given a null-terminated string containing words separated by a delimiter character (like comma , or space ' ').
Your task is to:
Do not use strtok() or any string library functions.
Example-1
Input: str = "cmd1,cmd2,cmd3" delimiter = ',' Output: cmd1 cmd2 cmd3
Example-2
Input: str = "ON OFF RESET" delimiter = ' ' Output: ON OFF RESET
Test Cases
Test Results
Input
cmd1,cmd2,cmd3 ,
Expected Output
cmd1 cmd2 cmd3