JavaScript- and Unicode-based character sorting method, system and device
A sorting method and character technology, which is applied in the fields of electrical digital data processing, instruments, calculations, etc., can solve the problems of performance waste, increased number of operations, and many comparisons, etc., and achieve the goal of highlighting substantive features, comprehensive usability, and improving performance Effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment Construction
[0053] Specific embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0054] Such as figure 1 A character sorting method based on JavaScript and Unicode is shown, including:
[0055] First, create a collation function in the JavaScript platform, denoted as the compare function. Then, extract two adjacent elements in the array to be sorted, record them as parameters a and b, and input parameters a and b into the compare function.
[0056] In the compare function, first judge whether a and b are equal, if they are equal, the compare function returns 1 directly; if they are not equal, further judge whether a has a value, if a has no value, the compare function directly returns 1; Then judge whether b has a value, if b has no value, the compare function returns -1 directly.
[0057] If b has a value, use the preset Unicode comparison method function to compare a and b, and the compare function generates a return value accord...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


