且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Javascript中的字符串中获取第n个字符?

更新时间:2023-02-05 08:18:42

使用 charAt 方法。就客户端或服务器而言,它取决于上下文。但你不应该信任客户输入。

Use the charAt method. As far as client or server, it depends on the context. But you should not trust client input.