Yes you can.
But you have to check LineItem and LineItem.Name is null and if .Spilt gives any results.
It is therefore you will get "Object reference is not set to an instance of object".
Try this code
if (LineItem != null && !string.IsNullOrEmpty(LineItem.Name))
{
string[] n = LineItem.Name.Split("@");
return n.Length > 0 ? n[0] : string.Empty;
}
else
{
return string.Empty;
}