C#
C#

help

Root Question Message

Surihia
Surihia11/7/2022
✅ Getting a string value from a set of strings stored in a text file

I have a text file which has strings written in this following pattern:
Name:Age:DOB:Designation

With data its as follows. imaginary names:
Jon:30:99:Editor

These strings are all in each line and I want to get the Name, Age, DOB, and Designation strings as separate strings so that I can use them as variables in my program to parse.
How do I go about in doing this ?
Angius
Angius11/7/2022
Split
TheSnowOwl
TheSnowOwl11/7/2022
yes.... that... didnt know about the handy dandy bot
Surihia
Surihia11/7/2022
How do I assign each of them as variables ?
Angius
Angius11/7/2022
Manually
Angius
Angius11/7/2022
It's an array, so just get the element you need and assign it
Angius
Angius11/7/2022
Might want to parse the numeric values to integers too
Surihia
Surihia11/7/2022
Got it. thank you so much for the help.
Surihia
Surihia11/7/2022
its fine. I will manage it with what I have now.
All that remains now is to determine how to read each line in a for loop.
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy