0

Element 0 value:

TimeEntries[0] = "False,S,16:00,21:00";

Element 0 is assigned to:

timeLine = USER.TimeEntries[i];

I want to perform a .Split() on timeLine but it must be a string. What's the easiest way to go about this?

Thanks

2
  • 2
    It looks like timeLine is a String, so it's not clear what you mean. It should help if you post more code, and say how you want to split it. Commented Apr 23, 2010 at 0:34
  • You're right, thanks Matthew. ChaosPandion made some assumptions as to what I was trying to do. Being succinctly clear is not always a virtue of mine ;). Commented Apr 23, 2010 at 2:14

1 Answer 1

2

Assuming TimeEntries is an object array you can do this:

var pieces = ((string)TimeEntries[0]).Split(',');
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the quick reply. Would never have thought I could type like that in c#- cool. I was trying .ToString.
@XO - No Problem, C# is full of surprises. I learn new techniques every day.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.