Tokenize string for a lot of programming language: link
In your case < tab > is a special character and it can be indicated as '\t'.
If you are using C programming language
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
int main(void) {
char *a[5];
const char *s="Sony\tA Hindi channel.";
int n=0, nn;
char *ds=strdup(s);
a[n]=strtok(ds, "\t");
while(a[n] && n<4) a[++n]=strtok(NULL, "\t");
// a[n] holds each token separated with tab
free(ds);
return 0;
}
For C++ without using boost library:
#include <string>
#include <sstream>
#include <vector>
#include <iterator>
#include <iostream>
#include <algorithm>
int main() {
std::string s = "Sony\tA Hindi channel.";
std::vector<std::string> v;
std::istringstream buf(s);
for(std::string token; getline(buf, token, '\t'); )
v.push_back(token);
// elements of v vector holds each token
}
Using C++ and boost: How to tokenize a string in C++
#include <iostream>
#include <string>
#include <boost/foreach.hpp>
#include <boost/tokenizer.hpp>
using namespace std;
using namespace boost;
int main(int, char**) {
string text = "Sony\tA Hindi channel.";
char_separator<char> sep("\t");
tokenizer< char_separator<char> > tokens(text, sep);
BOOST_FOREACH (const string& t, tokens) {
cout << t << "." << endl;
}
}