Is there a way a can replace the 1st instance of a character in a string with something eg.
^1402 WSN NIAMLAB^teertS htimS 005
to be
&1402 WSN NIAMLAB^teertS htimS 005
keeping the second ^ in place
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To replace the first instance of a character I would recommend the use of the
STUFFandCHARINDEXfunctions.STUFFinserts a string into another string. It deletes a specified length of characters in the first string at the start position and then inserts the second string into the first string at the start position.Note that you could also use
STUFFin a query as follows: