SOL9 Sample: StringTokenizerT

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * StringTokenizerT.cpp 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


// SOL9
// 2009/10/22

#include <sol/StringTokenizerT.h>
// 2011/09/04 Added the following line.
#include <sol/Locale.h>

void _tmain(int argc, TCHAR** argv)
{
  // 2011/09/04 Added the following line.
  Locale locale;

  char* line = "France  USA  UK Austria China  Japan 03-1234-5678  Hello World";

  StringTokenizerT<char> tokenizer(line);

  while(tokenizer.hasMoreToken()) {
    char token[128];
    token[0] = (char)0;
    tokenizer.getToken(token, 128);
    printf("Token=[%s]\n", token);
  }


  wchar_t* wline = L"This is your destiny. こんにちは 世界";

  StringTokenizerT<wchar_t> wtokenizer(wline);

  while(wtokenizer.hasMoreToken()) {
    wchar_t token[128];
    token[0] = (wchar_t)0;
    wtokenizer.getToken(token, 128);
    printf("WToken=[%S]\n", token);
  }

}


Last modified: 2 May 2016

Copyright (c) 2016 Antillia.com ALL RIGHTS RESERVED.