Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi Everyone,Is there a method in Razor to count the number of characters in a string? It seems like such a simple thing but I can't find a solution anywhere.Thanks
@("i'm string".Length) - Is this what you want?
You can make use of ToString().Length
So something like
@Model.YourProprertAlias.ToString().Length
Thanks guys, that works for me. Damn case sensitivity!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Find character length method
Hi Everyone,
Is there a method in Razor to count the number of characters in a string? It seems like such a simple thing but I can't find a solution anywhere.
Thanks
@("i'm string".Length) - Is this what you want?
You can make use of ToString().Length
So something like
Thanks guys, that works for me. Damn case sensitivity!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.