Vatan Soni
Vatan Soni

Reputation: 700

How to trim chinese and japanses characters

SELECT LOWER(LTRIM(RTRIM(' 価格 '))) AS TrimmedString;

It gives ?? as output.

How to put it here in function:

Create OR ALTER Function dbo.udf_GetTrimAndLower (@input NVARCHAR(max))
Returns NVARCHAR(max)
AS
BEGIN
DECLARE @output NVARCHAR(max);
    select @output = LOWER(LTRIM(RTRIM(@input)));

    RETURN (@output);
END

Upvotes: 0

Views: 227

Answers (1)

JonTout
JonTout

Reputation: 640

Try using this. I've added extra spaces for display purpose. You have to use the nvarchar data type.

SELECT LTRIM(RTRIM(N'       価格         ')) AS TrimmedString;

Upvotes: 1

Related Questions