sumair_coolboy Posted September 9, 2011 Posted September 9, 2011 want to remove first and last character of any word by using regex.... FOr example.. (HELLO) (WORLD) will return === HELLO WORLD and (HE/LLO) (WO/RLD) will return ====== HE/LLO WO/RLD or //Hello WOrld/ will return ========= Hello WOrld or (HELLO) (W/ORLD) STACKOVERFLOW) will return === HELLO W/ORLD STACKOVERFLOW (He(Lo) Wo®ld will return ===== He(Lo Wo®ld I dun want to replace all parenthesis ..I wish to replace First and last parenthesis of any word..... I m trying this ... temp = Regex.Replace(temp, @"^[!@#$%^&*()_+=[{]};:<>|./?,\'""-]+", " "); BUT this regex equation ONly remove FIRSt CHaracter IF FOund.... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.