Click here to Skip to main content
15,938,218 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to get first 10 characters from a string and last 16 characters of a string and concatenate it with '''?

String: You will Find Unix as well as Business Intelligence

output should be like : You will F'''ess Intelligence

What I have tried:

I tried to use Left and RIght function and then concatenate the two results with ''' but its not working.please suggest.
Updated 13-May-19 21:56pm

1 solution

SET @STR = 'You will Find Unix as well as Business Intelligence';
SELECT LEFT(@STR, 10) + '''''''' + RIGHT(@STR, 16)
Share this answer
Member 12965461 14-May-19 4:04am    
Thanks a worked
OriginalGriff 14-May-19 4:11am    
You're welcome!

In future though, try to avoid "its not working" - that doesn't tell us anything about the problem as we know "something isn't working" or you wouldn't have spent the time to post the question! :laugh:
Since we can't see your screen, access your HDD, or read your mind you need to give us actual information, such as sample code, error messages, inputs, outputs, expectations. The better the info you give us, the better a solution we can give you. Help us to help you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900