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
Can anyone point out how do i split a nodename or a textString to achieve something like this in html.
<strong>First</strong> Second
So after the first Space between a NodeName or any entry in a TextString I add a <Strong> Tag around the first word.
If my nodeName is called First Node in html i should render <strong>First</strong> Node likewise in a textstring.
Any idea please?
How about?
var nodeName = "First Node"; var pos = nodeName.IndexOf(' '); if (pos != -1) { <strong>@nodeName.Substring(0,pos)</strong>@nodeName.Substring(pos,nodeName.Length-pos) }
Jeavon
Hi Jeavon,
Thanks for the reply, yes this is what i was looking for.
Here is the final solution,
var nodeName = CurrentModel.Name;var pos = nodeName.IndexOf(' ');
//fuji
Hi Fuji,
That's great! Glad to have helped!
Thanks,
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Splitting a Word or NodeName
Can anyone point out how do i split a nodename or a textString to achieve something like this in html.
So after the first Space between a NodeName or any entry in a TextString I add a <Strong> Tag around the first word.
If my nodeName is called First Node in html i should render <strong>First</strong> Node likewise in a textstring.
Any idea please?
How about?
Jeavon
Hi Jeavon,
Thanks for the reply, yes this is what i was looking for.
Here is the final solution,
//fuji
Hi Fuji,
That's great! Glad to have helped!
Thanks,
Jeavon
is working on a reply...