How to Convert Non-English Characters to English Using JavaScript

前端 未结 4 1236
野性不改
野性不改 2021-01-19 10:52

I have a c# function which converts all non-english characters to proper characters for a given text. like as follows

public static string convertString(stri         


        
4条回答
  •  情歌与酒
    2021-01-19 11:14

    It's certainly possible to convert it...

    ToLower -> toLowerCase, Replace => replace, Length => length

    You'd have to code up IndexOfAny, but that's no big deal. But here's my question - why bother to do it client side? Why not call back to the server and execute the code all in one place? I do a lot of stuff like this. Check out the following link:

    http://aspalliance.com/1922

    It explains a way to bind, client-side, to server-side methods.

提交回复
热议问题