String.split

String version = 2.2.1;
String[] versionComponents = version.split("\.");


原文地址:https://www.cnblogs.com/faunjoe88/p/8042433.html