Multiple tabs in the table body verify that a certain field is equal (method 2: only use StringBuilder)

Multiple tabs in the table body verify that a certain field is equal (method 2: only use StringBuilder) /** * @desc: save validation * @author: hh * @date: 2023-4-3 */ public class SaveCheckRule implements IRule<AggBgmxysVO>{<!– –> @Override public void process(AggBgmxysVO[] aggvos) {<!– –> for (int i = 0; i < aggvos. length; i ++ ) […]

Solve the problem of low efficiency of String and StringBuilder appending content forward

Foreword I often encounter the problem of string splicing in work. Generally, if it is just a simple splicing, it can be realized directly by using String and “+”. If a large number of splicing is required, StringBuilder or StringBuffer is required. But whether it is String or StringBuilder, they are very efficient in appending […]

[Solved] Record stringBuilder setCharA(index) error array out of bounds SingIndexOutOfBoundsException

Record the stringBuilder setCharA(index) error array out of bounds SingIndexOutOfBoundsException StringBuilder res = new StringBuilder(20); //After initialization, a space of size 20 will be allocated for res. At this time, res.length() should be equal to 20. System.out.println(res.length()); //Print result: 0 //So when you execute res.setCharAt(15,’a’), the error array is out of bounds, why, 15 is […]