• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Jul 21, 2011 at 09:12 AM by biohazard for the following reason:

Solved on my own

avatar image
-1
Question by biohazard · Jul 21, 2011 at 08:45 AM · javascriptstringparsingtextasset

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

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Meltdown · Jul 21, 2011 at 09:28 AM 1
Share

This question isn't Unity specific, it is language specific. This forum is not the place to ask simple javascript/c# questions.

avatar image BerggreenDK · Jul 21, 2011 at 10:23 AM 0
Share

I need to see code too if I have to help next time.

1 Reply

  • Sort: 
avatar image
4

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?

Comment
Add comment · Show 8 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image biohazard · Jul 21, 2011 at 09:00 AM 0
Share

isn't working for string-arrays...only for normal strings.

also, don't try to imply that i didn't do my homework.

avatar image CHPedersen · Jul 21, 2011 at 09:06 AM 1
Share

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 ";"?

avatar image CHPedersen · Jul 21, 2011 at 09:20 AM 2
Share

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 minutes 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.

avatar image Aldwoni_legacy · Jul 21, 2011 at 09:22 AM 1
Share

biohazard, can you post the solution in case other people have the same problem?

avatar image Eric5h5 · Jul 21, 2011 at 09:30 AM 3
Share

@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.

Show more comments

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Writing certain values of an array into a different array 3 Answers

reading a .csv file on a mac? 3 Answers

How to convert a string to an int? 1 Answer

Sending a string via email from Unity? 2 Answers

A node in a childnode? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges