获取dataTable中字符串的长度(get length of a string in dataTable)

   IT问题网   2020-06-28 00:00:00

问 题

hiii all

i在数据表上创建一个for循环并从它调用一行调用路径看起来像那个字符串"1/2/3/4/7"



i想知道那个字符串的长度

i试图获得最后一个索引"/",但我发现我想要整个长度的字符串。





那么,有什么帮助吗?



谢谢

解决方案

使用 string.length property[ ^ ]。

嗨,



试试这个以获得长度的字符串



  string  str = "  1/2/3/4/7"; 
int ttl = str.length;
string [] resstr = str.split(' / );
int rwcnt = resstr.length;




在上面的代码中,ttl表示字符串的长度,包括''/''

和rwcnt意味着长度意味着排除''/''





所有最佳

标签:获取获得字符串长度



分享:

  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


热门推荐

使用大型数据库(working with large databases)

problem hi, we use sql server 2008 database ...

数据列表中的CountDown计时器(CountDown timers in a datalist)

problem im developing a auction website where students fr ...

插入记录器的问题(problem in inserting recorod)

problem cmd = new sqlcommand("insert into login1 values" ...

显示行到列(Display Row to Column)

problem how row to column value display in crystal report ...

Gridview中的复选框(Check box in Gridview)

problem if i check checkbox in gridview after that if i c ...

更新DatagridView记录(Updating DatagridView Records)

problem what am i doing wrong i can seem to u ...

如何从tortoiseSVN获取最新版本,然后使用CruiseControl.NET在msbuild中构建它(how to get latest version from tortoiseSVN and then build it in msbuild with CruiseControl.NET)

problem hi, i had a one asp.net solution in ...

请再帮忙,善良的人(Please help again, kind people)

problem hi all, so frustrated. i did two days'' researc ...

如何使用c#,net动态地在textarea中添加文本?(how to add text in textarea dynamically using c#,net)

problem string query = string.empty; query = "select mess ...

在Visual Studio 2010中创建Crystal Reports(Creating Crystal Reports in Visual Studio 2010)

problem im creating crystal reports using visual studio 2 ...

控制以填充数据并执行回发(control to fill the data and perform postback)

problem hi, is there any control to fill the data from da ...

System()vs CreateProcess()vs ShellExecute()(System() vs CreateProcess() vs ShellExecute())

problem here''s one for everyone, i''m running a batch fi ...

将TCL代码转换为C ++ ...(Convert a TCL code to C++...)

problem for {set i 128} {$ilt;256} {incr i 1} { eval lut ...

如何从二进制文件中读取浮点值(How Read Float value from Binary File)

problem hi. i do want to read float value from binary fi ...

使用.bak文件还原数据库(Restore Database using.bak file)

problem good evening everybody, please say how to restor ...

在gridview中显示总和(Show sum In gridview)

problem my gridview has data which looks like below (for ...

Ajax客户端脚本错误(Ajax Client side script error)

problem if (typeof(sys) === #39;undefined#39; ...

如何在UP和DOWN键进行编码(How to code at the UP and DOWN key)

problem i want to move picture box up and down when a use ...

如何计算excel 2003中的时间平均值(how to calculate time averge in excel 2003)

problem hii to all. if any body knows how to calculateave ...

控制相关问题(Control related issue)

problem respected sir, i have a page in which i m gettin ...