Skip to: Site menu | Main content

Login

Name: 
Password:
Remember me?
Register

Replacing a Character at a known position

written by Mark Rowlinson - Last updated Jan 2005

To replace a single character at a specified position you could use the following function:

 
Function ReplaceChar(OldString As String, Position As Long, NewChar As String) As String 
    ReplaceChar=Left$(OldString,Position-1) & NewChar & Mid$(OldString,Position+1) 
End Function