When you use the string segmentation can only be divided into four segments, the more will remind the array index of more than, because I use utf32 coding?
CodePudding user response:
Your get string content
CodePudding user response:
Not circular array of strings? You write that array is dead, of course, you will appear this problem
CodePudding user response:
Get string is a serial port to the data in the buffer
CodePudding user response:
reference weixin_45380906 reply: 3/f get string is a serial port to the data in the buffer even a serial port to read, also want to learn to write unit tests, or simply write a test program, see if you can't, this function can work normally an input structure, see if the output in line with expectations CodePudding user response:
Has nothing to do with segmentation, Such as string: 1, 2, 3, 4 After segmentation, only four number group, would you like to visit five members, and of course make a mistake, So this is because your string, before use, first check the data format, reuse, CodePudding user response:
// //abstract: //Splits a string into a maximum number of substrings -based on the characters in //an array. // //parameters: //the separator: //A character array that delimits the substrings in this string, an empty array //that contains no delimiters, or null. // //count: //The maximum number of substrings to return. // //options: //System. StringSplitOptions. RemoveEmptyEntries to omit the empty array elements from //the array returned; Or System. StringSplitOptions. None to include the empty array //elements in the array returned. // //return the result: //An array whose elements contain the substrings in this string that are delimited //by one or more characters in the separator. For more information, see the few //section. // //exception: //T: System. ArgumentOutOfRangeException: //count is negative. // //T: System. ArgumentException: //the options is not one of the System. StringSplitOptions values. Public String [] the Split (char [] separator, int count, StringSplitOptions options); // //parameters: //the separator: // //count: // //options: Public String [] the Split (char separator, int count, StringSplitOptions options=StringSplitOptions. None). // //parameters: //the separator: // //options: Public String [] the Split (char separator, StringSplitOptions options=StringSplitOptions. None). // //abstract: //Splits a string into substrings that are on the characters in an array. // //parameters: //the separator: //A character array that delimits the substrings in this string, an empty array //that contains no delimiters, or null. // //return the result: //An array whose elements contain the substrings from this instance that are delimited //by one or more characters in the separator. For more information, see the few //section. Public String [] the Split (params char [] the separator); // //abstract: //Splits a string into a maximum number of substrings -based on the characters in //an array. You also specify the maximum number of substrings to return. // //parameters: //the separator: //A character array that delimits the substrings in this string, an empty array //that contains no delimiters, or null. // //count: //The maximum number of substrings to return. // //return the result: //An array whose elements contain the substrings in this instance that are delimited //by one or more characters in the separator. For more information, see the few //section. // //exception: //T: System. ArgumentOutOfRangeException: //count is negative. Public String [] the Split (char [] separator, int count); // //abstract: //Splits a string into substrings -based on the characters in an array. You can //specify been the substrings include empty array elements. // //parameters: //the separator: //A character array that delimits the substrings in this string, an empty array //that contains no delimiters, or null. // //options: //System. StringSplitOptions. RemoveEmptyEntries to omit the empty array elements from //the array returned; Or System. StringSplitOptions. None to include the empty array //elements in the array returned. // //return the result: //An array whose elements contain the substrings in this string that are delimited //by one or more characters in the separator. For more information, see the few //section. // //exception: //T: System. ArgumentException: //the options is not one of the System. StringSplitOptions values. Public String [] the Split (char [] separator, StringSplitOptions options); // //parameters: //the separator: // //count: // nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull