Re: Creating Full Name from given, initials, sn, when some might be null
- From: "ssg31415926" <newsjunkmail@xxxxxxxxx>
- Date: 28 Feb 2007 09:46:43 -0800
Thanks for your suggestion - I like your version better than mine!
On 27 Feb, 16:54, "H. S. Lahman" <h.lah...@xxxxxxxxxxx> wrote:
Responding to Ssg31415926...
This forum is usually concerned with OOA/D issues rather that tactical
coding practices in particular OOPLs, so you might get a better answer
in the appropriate language or programming forum. But as long as we're
here...
You could make it more compact by making the string operations generic
(using appropriate syntax for whatever language you are using):
static String nameIdentifiers [3] = {"GivenName", "initials", "sn"};
StringBuilder sb = new StringBuilder();
bool previousValueSet = FALSE;
for (i = 0; i < 3; i++)
{
if (src[0].Properties[nameIndentifiers[i]].Count > 0)
{
if (previousValueSet)
sb.Append(" ");
sb.Append(src[0].Properties[nameIdentifiers[i]][0].ToString());
previousValueSet = TRUE;
}
}
*************
There is nothing wrong with me that could
not be cured by a capful of Drano.
H. S. Lahman
h...@xxxxxxxxxxxxxxxxx
Pathfinder Solutionshttp://www.pathfindermda.com
blog:http://pathfinderpeople.blogs.com/hslahman
"Model-Based Translation: The Next Step in Agile Development". Email
i...@xxxxxxxxxxxxxxxxx for your copy.
Pathfinder is hiring:http://www.pathfindermda.com/about_us/careers_pos3.php.
(888)OOA-PATH
.
- References:
- Creating Full Name from given, initials, sn, when some might be null
- From: ssg31415926
- Re: Creating Full Name from given, initials, sn, when some might be null
- From: H. S. Lahman
- Creating Full Name from given, initials, sn, when some might be null
- Prev by Date: Re: Relational-to-OOP Tax
- Next by Date: Re: data structure complexity vs. application maintenance cost
- Previous by thread: Re: Creating Full Name from given, initials, sn, when some might be null
- Next by thread: Question About Builder Object
- Index(es):
Relevant Pages
|