子字符串代码在 c# 中不起作用

本文关键字:不起作用 字符串 代码 | 更新日期: 2023-09-27 17:56:56

我在下面写了一行代码:

<asp:Label ID="lblDetail" runat="server" Text='<%#_14Communities.Web.CODEFILES.SECUREFILES.WebUtility.LimitString(Server.HtmlDecode((string)Eval("Purpose")).ToString().Replace("'n","<br/>"),200) %>'></asp:Label>

现在我只想显示 200 个字符。它不起作用。

子字符串代码在 c# 中不起作用

您可以使用简单的内在 dotNet 函数substring

yourString.Substring(0, 200);