Brian & Laura McGarvie
Welcome to Brian and Laura McGarvie’s homepage, find out more information on Brian M McGarvie and his it consultancy, and about our personal adventures and experiances…

Capitalization for us Mc’s and Mac’s!

March 12th, 2008 by Brian M McGarvie

Needed to capltalize free ringtones sprint download ringtones free cricket ringtones get free ringtones for my cell phone free nokia ringtones tracfone nokia composer ringtones virgin mobile usa ringtones christian download free ringtones free ringtones for nextel phone dash mobile ringtones t info polyphonic remember ringtones download free ringtones free real tone ringtones free ringtones for t mobile phone blackberry free mp3 ringtones free real ringtones tone download ringtones motorola free real ringtones sprint motorola ringtones mosquito ringtones Mc’s and Mac’s? Here’s a quick function for it…


/**
* Proper capitalization for us Mc’s and Mac’s!
*/
function celticMcCaps(lastName) {
var capLastName = lCase(lastName);
if (left(lastName,2) eq “Mc”) {
capLastName = uCase(left(lastName,1)) & lCase(mid(lastName,2,1)) & uCase(mid(lastName,3,1)) & lCase(right(lastName,len(lastName)-3));
return capLastName;
}
else if (left(lastName,3) eq “Mac”) {
capLastName = uCase(left(lastName,1)) & lCase(mid(lastName,2,1)) & lCase(mid(lastName,3,1)) & uCase(mid(lastName,4,1)) & lCase(right(lastName,len(lastName)-4));
return capLastName;
}
else return lastName;
}

Found at http://cflib.org/udf.cfm?ID=896

Posted in ColdFusion, Programming

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.