Capitalization for us Mc’s and Mac’s!
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