Cryptic Studios Team
Join Date: Aug 2012
Posts: 1,227
# 11
06-13-2014, 10:09 AM
Good ideas. I'll amend the request.
Career Officer
Join Date: Aug 2012
Posts: 177
# 12
06-13-2014, 10:33 AM
Quote:
Originally Posted by crypticfrost View Post
Good ideas. I'll amend the request.
I would design this as follows:

Quote:
public string FullName()
{
string fullName;

get
{
if (FirstName != "" && LastName != "")
{
fullName = FirstName + " " + LastName;
}
else if (FirstName != "" || LastName != "")
{
if (FirstName == "")
{
fullName = LastName;
}
else if (LastName == "")
{
fullName = FirstName;
}
}
else
{
fullName = NickName;
}

return fullName;
}
}
Sorry, I can't get the indentation right but this should return a string for a property in C#.

Thanks again! Of all the Crypticfrosts you're the best Crypticfrost I know!

Joe_King

Please leave comments or suggestions on the main thread for Homage to Galris at the following link.
Also feel free to check out some of my other projects at the following link.

Last edited by chepetico2; 06-13-2014 at 01:26 PM.
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


All times are GMT -7. The time now is 10:39 PM.