Good evening,
Suppose, there is a file that has 1 line
Suppose there needs to be a task to read this line into a String[]Code:TAGS = 107,35,75,88
See my newbish Java and questions below (code works)
My question to you is:Code:private Properties inputFileProperties = new Properties();
String myTags = (String) inputFileProperties.get("TAGS");
String[] tags = new String[myTags.split(",").length];
int i = 0;
for (String x : myTags.split(",")) {
tags[i] = x;
i++;
}
1. Any way i can avoid "split"? I am mindful of that fact that split is expensive
2. Is there a better way to get a comma delimited string and push it into an array?
Assume:
1. I have no control over how many elements are comma delimited in the line
2. I don't have to do any data validation
Thank you very much for reading this and responding
PS: If you tell me how i can load it up from properties straight into a String array, it would be above awesome!

