DWUTKA at marlow.com
DWUTKA at marlow.com
Mon Jul 24 16:06:39 CDT 2006
Don't know of a default function to do this, however, you could make one with just a few lines in a function: Function NumOfSpecificChar(strText as String, strCharacter as string) As Long Dim strTemp as string strTemp=Replace(strText,strCharacter,"") NumOfSpecificChar=(Len(strText)-Len(strTemp))/Len(strCharacter) End Function Drew -----Original Message----- From: John Skolits [mailto:askolits at ot.com] Sent: Monday, July 24, 2006 2:58 PM To: accessD at databaseadvisors.com Subject: [AccessD] Number of a specific characters in a string I'm sure I could write some code for this, but is there a function that returns the occurrences of a specific character within a string. Ie: If the string is strSTRING = " Hello how are you, today" And I put it in a function called NumOfSpecifcChar() where the firsts argument is the string and the second the string value to search for. integerValue = NumOfSpecifcChar (strSTRING, "o") It would return a '4' -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com