vb 如何拆分这样的字符串!!!
有这样的字符串str1:A(1),B(2),C(3)拆分成str2:A,B,C和str3:1,2,3两个字符串,更重要的是str1输入获取的,并不是固定的,也可能是A(1),B(2)或者D(12),拆分成类似str2和str3的样式。怎么做呢?请高手们指点,急用啊!!!
C#写的,你修改下吧
static void Main(string[] args)
{
string str1 = "A(1),B(2),C(3),D(12)";
StringBuilder s1 = new StringBuilder();
int index = -1;
char c;
StringBuilder s2 = new StringBuilder();
for (int i = 0; i < str1.Length;i++ )
{
c = str1[i];
if (Char.IsLetter(c))
{
s1.Append(c);
s1.Append(",");
}
if (c == '(')
{
相关问答:
请教一下:我用vb写了一个调用Illustrator的测试程序,代码很简单:Private Sub Command1_Click()
Dim app As New Illustrator.Application
Dim doc As Illustrator.Document
Dim thislayer As Illustrator.Layer ......
用VB怎么只针对windows自带的文件的右键添加菜单 如(.txt .doc)
这个是只针对以这两个为扩展名的文件操作
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\txtfile\shell\[随便起名]\command]
@= ......
vb将winsock控件封装到dll问题 有什么好的思路? 如果用Socket API呢?
例如,像下面这样封装Winsock控件,行的通?
创建ActiveX dll,添加窗体frmClient,加入WinSock控件wskClient。
类代码:
Option Expli ......
在vb中怎么判断,插入到数据库中的值是重复的,本人才刚接触VB语言,甚是有好多地方还不懂,还请各位大侠们给出代码,谢谢了呀!!!
插入之前select一下阿。
或者写一个组合SQL插入语句,例如
IF not Exist(
& ......