ineztia
ineztia

Reputation: 825

issue with RazorEngine variable parsing

In my page, I'd like to display a string like this:

Today is (x)th of july

Where (x) is calculated by progam at runtime and passed as @Model.Number to RazorEngine

However the following template format will not work as I expected

Today is @Model.Numberth of july

In many cases I have to put variables and plain text together without spaces. How can I improve my code to make it work?

Upvotes: 2

Views: 67

Answers (1)

Carlos Galan
Carlos Galan

Reputation: 86

try using this

Today is @(Model.Number)th of july

Upvotes: 3

Related Questions