First, in broadest terms, the function's purpose is to "match what is in the first pattern, then replace it with the second pattern, using the third argument as the string to operate on."
The case statement works like its counterparts in traditional programming languages: It compares its argument to each pattern in a list; when a match is found, the corresponding code executes.
case 语句的工作方式与传统编程语言中的对应结构相似。 它将其参数与列表中的每个模式比较;当找到匹配项时,则执行对应的代码。