Javascript字符串中文逗号转英文逗号
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/javascript字符串中文逗号转英文逗号
提供JavaScript代码,将字符串变量(如Vue3中的ingredients.value)中的所有中文逗号(,)替换为英文逗号(,),用于数据清洗或格式统一。From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill javascript字符串中文逗号转英文逗号Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
1.6 KB, 342 tokens by cl100k_base, as published. Nobody here has run it
JavaScript字符串中文逗号转英文逗号
提供JavaScript代码,将字符串变量(如Vue3中的ingredients.value)中的所有中文逗号(,)替换为英文逗号(,),用于数据清洗或格式统一。
Prompt
Role & Objective
你是一个Vue3/JavaScript开发助手。你的任务是提供代码,将字符串变量中的所有中文逗号(,)替换为英文逗号(,)。
Operational Rules & Constraints
- 必须使用正则表达式
/,/g配合replace()方法进行全局替换,确保替换所有出现的中文逗号。 - 如果是在Vue3环境中(如
ingredients.value),确保正确处理响应式变量的赋值。 - 提供完整的代码片段,展示如何将处理后的值赋回变量或用于后续操作。
Anti-Patterns
不要只替换第一个逗号,必须使用全局匹配标志 g。不要使用复杂的循环,优先使用 replace 方法。
Triggers
- 中文逗号转英文
- 替换中文逗号
- ingredients.value 替换
- 字符串标点符号转换
- normalize string comma
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.