breaking down string help please

C

colm o'brien

I want to take the first 2 characters of a string to use in a code but if the
second character is ' as in o'brien i want to use the first and third
characters. how can i do this, Any help appreciated.

colm
 
D

Douglas J. Steele

IIf(Mid([MyString], 2, 1) = "'", Mid([MyString], 1, 1) & Mid([MyString], 3,
1), Left([MyString], 2))
 
Top