Skip to content

Instantly share code, notes, and snippets.

View ivary43's full-sized avatar
🏠
Working from home

Manish Kumar ivary43

🏠
Working from home
  • IIT Patna
View GitHub Profile
@ivary43
ivary43 / split.cpp
Created July 16, 2019 19:12
A wrapper/alternative of strtok() c
#include<bits/stdc++.h>
vector<string> stringSpilt(string str, string delimeter) {
vector<string> res ;
int n = (int)str.length();
char ch_arr[n+1];
strcpy(ch_arr, str.c_str());
const char* temp_delimeter = delimeter.c_str();
char* token = strtok(ch_arr, temp_delimeter);
while (token != NULL)