in javascript how can i get a value indicating a character's general category like java Character.getType?

后端 未结 2 802
抹茶落季
抹茶落季 2021-01-22 22:13
input char:a      (unicode:97) output type:2
input char:Space  (unicode:32) output type:12

in java i can use code: \"int type = Character.getType(unico

2条回答
  •  孤街浪徒
    2021-01-22 22:32

    Well, there's the nodeType property which will tell you if it is a text node or an HTML element, for example. As far as obtaining the unicode category, I don't believe there is a native function for that. You can try this plugin which will offer unicode support for regex:

    http://xregexp.com/plugins/

    http://www.javascriptkit.com/domref/nodetype.shtml

提交回复
热议问题