Hi t01714500930,
Use Split function like below code.
HTML
<asp:Label ID="Label3" runat="server" /><br />
<asp:Label ID="Label4" runat="server" />
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
Label3.Text = "aspforums site is good site";
string[] subs = Label3.Text.Split(' ');
if(subs.Length > 0)
{
Label4.Text= subs[0];
}
else
{
Label4.Text= Label3.Text;
}
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Label3.Text = "aspforums site is good site"
Dim subs As String() = Label3.Text.Split(" "c)
If subs.Length > 0 Then
Label4.Text = subs(0)
Else
Label4.Text = Label3.Text
End If
End Sub
Output
aspforums