如何使用split()方法 [英] how to use split() method
本文介绍了如何使用split()方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在下面的代码中使用split方法
这里我通过这个自定义配置项ManagerAccountsStatus获取值我希望在split中传递这个()
这个ManagerAccountsStatus包含4个值(数组值),逗号为sapareted
if (manager.managerkey.Split())
{
if (!AccountManager.SetAAccountManagerstatus(session,_Manager,_account))
{
throw new XYException();
}
}
任何人都可以帮助我在这上面?
解决方案
使用以下内容:
string [] results = manager.managerkey.Split(' ,'); // 将为您提供一个由逗号分隔的4个字符串数组
i want to use split method for below code
here i am fetching values through this custom config item "ManagerAccountsStatus" i want pass this in split()
this "ManagerAccountsStatus" contains 4 values(array values) with comma sapareted
if (manager.managerkey.Split() )
{
if (!AccountManager.SetAAccountManagerstatus(session, _Manager, _account))
{
throw new XYException();
}
}
can any one help me on this?
解决方案
Use the following :
string[] results = manager.managerkey.Split(','); // will give you an array of 4 string broken by a comma
这篇关于如何使用split()方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文