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...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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...