Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有java String超过 160 个字符,我想create substring为前 150 个字符形成该字符串。
java String
create substring
我已经为此谷歌了,但我得到的是在特殊字符处制作子字符串。
请告诉我这样做的可能方法..
String#substring(int beginIndex, int endIndex)是您所需要的。
String mySubString = myString.substring(0, 150);