开发者

How to write the Extension method for my View using jquery or javascript

开发者 https://www.devze.com 2023-02-14 12:30 出处:网络
I have a output string something like this 开发者_开发技巧<*>$<@>%<# I need a extension method for this string as Input

I have a output string something like this

开发者_开发技巧
<*>$<@>%<#

I need a extension method for this string as Input

and I need to ass a Space after each > < simbol.

Ouput should be

< *> $< @> %< #

i need to out put something like this. I need to make sure allways one Space after < > symbol..

Ex: if I get something like this as input < $ i need to leave it as it is...only one space need to be added.

Can any body help me out how to do this?

thanks in advance


public static string KumarsExtension(this string input)
{
    return input.Replace(">", "> ").Replace("<", "< ");
}
0

精彩评论

暂无评论...
验证码 换一张
取 消