30秒学会 JavaScript 片段 – toTitleCase
Converts a string to title case.
Break the string into words, using a regexp, and combine them capitalizing the first letter of each word and adding a whitespace between them.
继续阅读 30秒学会 JavaScript 片段 – toTitleCase