Inserting special character in view

3

I have an HTML table where one of your td needs to enter the following information:

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

I wanted to insert this way:

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

But when you join the º character with the variable OrderSendº the compiler understands that º is part of the variable name

How can I join this character with the value of the variable?

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

The output in view should be: , but this is output like this: 1 º

    
asked by anonymous 11.05.2017 / 14:26

2 answers

3

Use of parentheses, so razor will understand that the " º " symbol is not part of the variable name.

<td>@(item.OrderSend)º</td>
    
11.05.2017 / 14:33
3

Another way to do this is to use string.Concat , to concatenate the strings.

<td>@string.Concat(item.OrderSend, "º")</td>
    
11.05.2017 / 14:35