Jan 12, 2009 #1 tuzojazz Programmer Joined Dec 26, 2005 Messages 58 Location MX Hi guys! I have this code PRINT REPLACE('EÉ', 'É' , 'X' ) and I get this XX and I want to consider diacritics to get EX how can I do it? Thanks!
Hi guys! I have this code PRINT REPLACE('EÉ', 'É' , 'X' ) and I get this XX and I want to consider diacritics to get EX how can I do it? Thanks!
Jan 12, 2009 1 #2 gmmastros Programmer Joined Feb 15, 2005 Messages 14,912 Location US You need to use an accent sensitive collation. There are several to choose from. The one I use in the example below is also case sensitive. Code: PRINT REPLACE('EÉ', 'É' [!]collate Latin1_General_BIN[/!], 'X') -George "The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom Upvote 0 Downvote
You need to use an accent sensitive collation. There are several to choose from. The one I use in the example below is also case sensitive. Code: PRINT REPLACE('EÉ', 'É' [!]collate Latin1_General_BIN[/!], 'X') -George "The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
Jan 12, 2009 #3 gmmastros Programmer Joined Feb 15, 2005 Messages 14,912 Location US Like I said... Latin1_General_Bin is also case sensitive, so... Code: PRINT REPLACE('Ee', 'E' collate Latin1_General_BIN, 'X') -- Returns Xe PRINT REPLACE('Ee', 'e' collate Latin1_General_BIN, 'X') -- Returns EX There's a ton of collations to choose from: http://msdn.microsoft.com/en-us/library/ms144250.aspx -George "The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom Upvote 0 Downvote
Like I said... Latin1_General_Bin is also case sensitive, so... Code: PRINT REPLACE('Ee', 'E' collate Latin1_General_BIN, 'X') -- Returns Xe PRINT REPLACE('Ee', 'e' collate Latin1_General_BIN, 'X') -- Returns EX There's a ton of collations to choose from: http://msdn.microsoft.com/en-us/library/ms144250.aspx -George "The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
Jan 13, 2009 Thread starter #4 tuzojazz Programmer Joined Dec 26, 2005 Messages 58 Location MX Thanks guys! It works!! Upvote 0 Downvote
Jan 14, 2009 #5 ESquared Programmer Joined Dec 23, 2003 Messages 6,129 Location US Note that you can put the collate clause on any of the three string literals in the replace expression... or on all three if you want. Upvote 0 Downvote
Note that you can put the collate clause on any of the three string literals in the replace expression... or on all three if you want.