The length of the array of the split string

tags: String

String str1 = "abc";
String[] list1 = str1.split("a");
//list1.length = 2;

String str2 = "bca";
String[] list2 = str2.split("a");
//list2.length = 1;

String str3 = "abca";
String[] list3 = str3.split("a");
//list3.length = 2;

Intelligent Recommendation

Continuous input string, press length of 8 outputs each string to a new split string array - online programming Huawei

Title: continuous input string, by the length of the output string array to a new resolution after each string 8; Outline of Solution: Analyzing each input string length is a multiple of 8, if a multi...

More Recommendation

Python string is split by fixed length

Now need to separate a string according to each length, change into a certain format like:mac = ’902B345FB021’Change tomac = ’90-2B-34-5F-B0-21’ method one: This method is rela...

Split the specified array length Java ~

4 by resolving a set of array length, directly on the code to be optimized - Final output results:...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top