String Builder vs Lists

前端 未结 5 1930
野的像风
野的像风 2021-01-17 01:19

I am reading in multiple files in with millions of lines and I am creating a list of all line numbers that have a specific issue. For example if a specific field is left bla

5条回答
  •  有刺的猬
    2021-01-17 01:22

    My end goal is to out put a message like "Specific field is blank on 1-32, 40, 45, 47, 49-51

    If that's the end goal, no point in going through an intermediary representation such as a List - just go with a StringBuilder. You will save on memory and CPU that way.

提交回复
热议问题