Inserting special character in view

Asked

Viewed 80 times

3

I have an HTML table where one of your td I need to insert the following information:

<td>@item.OrderSend º</td>

I would like to insert in this way:

<td>@item.OrderSendº</td>

However, when combining character º with variable OrderSendº compiler understands that º is part of the variable name

How can I merge this character with the variable value?

The variable returns integer values, for example 1, 2, 3.

The exit in view should be: , but it’s coming out like this: 1 º

2 answers

3


Use item.OrderSend in parentheses, so the Razor will understand that the symbol "º" is not part of the variable name.

<td>@(item.OrderSend)º</td>

3

Another way to do it is by using string.Concat, to concatenate the strings.

<td>@string.Concat(item.OrderSend, "º")</td>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.