我有一堆字符串我想用.endsWith函数分隔它们.我想写这样的东西:
.endsWith
if (textString.endsWith("_xyz")) //do this else if (textString.endsWith("_xyz" || "_pqr" || "_abc")) throw new Error();
是否可以使用.endsWith是否有另一种达到上述要求的最佳方式?
java string
java ×1
string ×1