✅ 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:
With data its as follows. imaginary names:
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 ?
7 Replies
Split
Angius#1586
REPL Result: Success
Result: string[]
Compile: 499.135ms | Execution: 28.075ms | React with ❌ to remove this embed.
yes.... that... didnt know about the handy dandy bot
How do I assign each of them as variables ?
Manually
It's an array, so just get the element you need and assign it
Might want to parse the numeric values to integers too
Got it. thank you so much for the help.
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.
Closed!