SUN SUN - 5 months ago 22
ASP.NET (C#) Question

remove value from after space detects

I just want to remove values from string after space


if string value is (Music powerbanks pendrives) then it should replace it with (Music)

string productCategory = "Music PowerBank pendrives";

I just want to get first word from string

int index = productCategory.IndexOf(' ');
if (index != -1)
    productCategory = productCategory.Substring(0, index);