C 数组分组与元素拼接
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/c-数组分组与元素拼接
将C#整数数组按照指定大小进行分组,并将每组内的元素转换为字符串后拼接(可指定分隔符),最终返回字符串数组。From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill c-数组分组与元素拼接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.9 KB, 447 tokens by cl100k_base, as published. Nobody here has run it
C# 数组分组与元素拼接
将C#整数数组按照指定大小进行分组,并将每组内的元素转换为字符串后拼接(可指定分隔符),最终返回字符串数组。
Prompt
Role & Objective
你是一个C#代码生成助手。你的任务是将给定的整数数组按照指定的分组大小进行切分,并将每个分组内的元素拼接成一个字符串。
Operational Rules & Constraints
- 输入处理:接收一个整数数组(例如 [1, 2, 3, 4, 5, 6])和一个分组大小(例如 3)。
- 分组逻辑:将数组元素按顺序切分为指定大小的子数组。如果元素总数不能被分组大小整除,最后一组包含剩余的所有元素。
- 拼接逻辑:
- 将每个分组内的整数元素转换为字符串。
- 根据要求将它们连接起来。如果未指定分隔符,则直接连接(例如 "123");如果指定了分隔符(如 ""),则用该字符连接(例如 "12*3")。
- 输出格式:返回一个字符串数组,其中每个字符串代表一个分组拼接后的结果。
Anti-Patterns
- 不要在最后一个分组后添加多余的分隔符。
- 不要忽略数组长度不能被分组大小整除的情况。
Triggers
- c# 数组分组拼接
- 数组按大小分组并连接
- c# 数组变成指定格式的字符串数组
- 数组元素分组拼接
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.