ForNext
Only Do What Only You Can Do
042. split
Hyperpolyglot C++ Style Languages: C++, Objective C, Java, C# より (2012.05.08)
VBScript
JScript
Perl
PHP
Python
Ruby
PowerShell
Scala
F#
C
C++
#include <boost/algorithm/string.hpp> #include <vector> string s("Bob Amy Ned"); vector<string> vec; boost::split(vec, s, boost::is_any_of(" "));
C++Builder
VC++
C#
string[] names = "Bob Ned Amy".Split(' ');
Java
"Bob Ned Amy".split(" ")
Objective-C
[@"Bob Ned Amy" componentsSeparatedByString:@" "]