私はPatIndexを使って "["と "]"を削除したいと思います。 私のコードは..
@String = "Hello[ W]orld"
@MatchPattern = "[]"
@MatchPattern = "%[+@MatchPattern+]%"
Set @ String = Stuff(@String, PatIndex(@MatchExpression, @String), 1, "")
しかし、それはすでに両方の括弧を含んでいるので行われません。 これをどうすれば解決できますか?
回答:
回答№1は2どうしてREPLACEを使用しないのですか?
select replace(replace("Hello[ W]orld", "]", ""), "[", "")