|
|
|
Click here to copy the following block | Function PluralToSingular(ByVal plural As String) As String Dim lower As String = plural.ToLower() Dim res As String
If lower = "feet" Then res = "Foot" ElseIf lower = "geese" Then res = "Goose" ElseIf lower = "men" Then res = "Man" ElseIf lower = "women" Then res = "Woman" ElseIf lower = "criteria" Then res = "Criterion"
ElseIf lower.EndsWith("ies") AndAlso "aeiou".IndexOf(lower.Substring _ (lower.Length - 4, 1)) < 0 Then res = plural.Substring(0, plural.Length - 3) + "y" Else res = plural.Substring(0, plural.Length - 1) End If
If plural = lower Then Return res.ToLower() ElseIf plural = plural.ToUpper() Then Return res.ToUpper() Else Return res End If End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|