J
Jane Doe
Hi all,
I have a Ruby program that reads in a text file of first names and
surnames and prints them out in alphabetical order. Now I'm trying to
add the option: if a person has a middle name, to print that out too and
if they don't, to just print out their first name and surname.
I'm having issues when allowing a person to have a middle name or not
though. I think it is a problem with my to_s method and when I create a
new person. I have attached my ruby file, if anyone has any help or
advice on how to start this please let me know.
The text file of names is just like this, with the first entry having no
middle name and the second one having a middle name: John,Doe
Jane,Doe,Amy
I have a Ruby program that reads in a text file of first names and
surnames and prints them out in alphabetical order. Now I'm trying to
add the option: if a person has a middle name, to print that out too and
if they don't, to just print out their first name and surname.
I'm having issues when allowing a person to have a middle name or not
though. I think it is a problem with my to_s method and when I create a
new person. I have attached my ruby file, if anyone has any help or
advice on how to start this please let me know.
The text file of names is just like this, with the first entry having no
middle name and the second one having a middle name: John,Doe
Jane,Doe,Amy