- Home /
Solved on my own
How can i split a string[] ?
Hello people, i've parsed a Text asset and now i got each line of the TextAsset inside a String[]. Now i need to split the String[] again at each semicolon. How can i do that? :)
any help is appreciated
thanks in advance
bio
This question isn't Unity specific, it is language specific. This forum is not the place to ask simple javascript/c# questions.
Answer by CHPedersen · Jul 21, 2011 at 08:52 AM
Use String.Split:
http://msdn.microsoft.com/en-us/library/system.string.split.aspx
on each of the elements of your array?
isn't working for string-arrays...only for normal strings.
also, don't try to imply that i didn't do my homework.
Your question didn't imply you HAD done your homework. It did, however, imply you appreciated "any help". Downvoting is not "appreciating any help".
Your question is too incompletely phrased to be able to answer properly. To be able to describe how to parse data for you, you have to give an example of what your data looks like. Splitting strings based on some character is typically done with String.Split. What does your string[] contain? Do some elements of the array consist of a single ";"?
The thing is, UA should really be used as a last resort, in my humble opinion. Users learn Unity through self-study far quicker than having solutions handed to them, so only when all methods and ideas known to the user have been exhausted, should the user post a question and consult more experienced users. Ask yourself this: If you can solve your own question within 28 $$anonymous$$utes of having asked it, did you then exhaust your own knowledge before you polled ours? If it only took just shy of half an hour, then HAD you really done your homework?
All things aside, I never did mean to create a toxic atmosphere, and I'm sorry if you took offense. :) I'm glad you did manage to get it solved, and a nice day to you, too.
biohazard, can you post the solution in case other people have the same problem?
@biohazard: In what way was the supplied link "not related to the subject"? It's precisely related to the subject that you're asking about (splitting strings). I doubt there are any links which would be more relevant.
Follow this Question
Related Questions
Sending a string via email from Unity? 2 Answers
A node in a childnode? 1 Answer
How do you display a saved name on the screen? 2 Answers
Parsing a float from a string with text 1 Answer
Print String 3 Answers