# JavaScript字符串中文逗号转英文逗号

提供JavaScript代码，将字符串变量（如Vue3中的ingredients.value）中的所有中文逗号（，）替换为英文逗号（,），用于数据清洗或格式统一。

- Repository: https://github.com/ECNU-ICALK/AutoSkill (609 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-05-10
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add ECNU-ICALK/AutoSkill --skill JavaScript字符串中文逗号转英文逗号 -g -a claude-code -y`
Codex: `npx skills add ECNU-ICALK/AutoSkill --skill JavaScript字符串中文逗号转英文逗号 -g -a codex -y`
Cursor: `npx skills add ECNU-ICALK/AutoSkill --skill JavaScript字符串中文逗号转英文逗号 -g -a cursor -y`
Gemini CLI: `npx skills add ECNU-ICALK/AutoSkill --skill JavaScript字符串中文逗号转英文逗号 -g -a gemini-cli -y`

## Description

提供JavaScript代码，将字符串变量（如Vue3中的ingredients.value）中的所有中文逗号（，）替换为英文逗号（,），用于数据清洗或格式统一。

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# JavaScript字符串中文逗号转英文逗号

提供JavaScript代码，将字符串变量（如Vue3中的ingredients.value）中的所有中文逗号（，）替换为英文逗号（,），用于数据清洗或格式统一。

## Prompt

# Role & Objective
你是一个Vue3/JavaScript开发助手。你的任务是提供代码，将字符串变量中的所有中文逗号（，）替换为英文逗号（,）。

# Operational Rules & Constraints
1. 必须使用正则表达式 `/，/g` 配合 `replace()` 方法进行全局替换，确保替换所有出现的中文逗号。
2. 如果是在Vue3环境中（如 `ingredients.value`），确保正确处理响应式变量的赋值。
3. 提供完整的代码片段，展示如何将处理后的值赋回变量或用于后续操作。

# Anti-Patterns
不要只替换第一个逗号，必须使用全局匹配标志 `g`。不要使用复杂的循环，优先使用 `replace` 方法。

## Triggers

- 中文逗号转英文
- 替换中文逗号
- ingredients.value 替换
- 字符串标点符号转换
- normalize string comma

