在C#字母的增量 [英] Increment of Alphabet in c#

查看:103
本文介绍了在C#字母的增量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我导出我的数据转换成 Excel中使用的Open XML 。现在我要像递增字母为列'A1'到'B1',......Z1,AA1。

I am exporting my data into Excel Using Open XML. now i want to increment of alphabet like as columns 'A1' to 'B1',...'Z1', 'AA1'.

我有分配A1为变量,我想增加字母为B1。

I have assign 'A1' into variable and i want to increment alphabet to 'B1'.

请通过可以提供任何方法/代码。增量字母'A1'到'B1'..'Z1,AA1

Please provide any method/code through that can increment alphabet 'A1' to 'B1'..'Z1','AA1'.

推荐答案

这是可以做到:

char c1 = 'A';
c1++; // c1 is 'B' now

和您可以添加编号为字符串,即使级联字符可以产生同样的方式:

and you can add the numbering as a string, even the concatenated characters can be generated the same way:

伪代码:

If Reached_Z Then Add_Another_A

这篇关于在C#字母的增量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆