首页 新闻 会员 周边

c# split() 问题

0
悬赏园豆:5 [已解决问题] 解决于 2012-08-07 09:38

string[] pic1 = productPic.Split("JPG");

允许以后提示:

“string.Split(params char[])”最匹配的重载方法具有一些无效参数

jason2013的主页 jason2013 | 小虾三级 | 园豆:1998
提问于:2012-08-07 09:05
< >
分享
最佳答案
1

你的参数本来就给错了

Split(Char[])

Split(Char[], Int32)

Split(Char[], StringSplitOptions)

Split(String[], StringSplitOptions)  -----productPic.Split(new[] { "JPG" }, StringSplitOptions.None);

Split(Char[], Int32, StringSplitOptions)

Split(String[], Int32, StringSplitOptions)

==========string[] pic1 = productPic.Split("JPG");======

你的匹配那个呢??

  

收获园豆:2
Angkor--:-- | 小虾三级 |园豆:1086 | 2012-08-07 09:24
其他回答(3)
0

Split 单个或多个 char 字符,不接受字符串。

收获园豆:1
Launcher | 园豆:45045 (高人七级) | 2012-08-07 09:17
1
productPic.Split(new string[] { "JPG" }, StringSplitOptions.None);
收获园豆:1
artwl | 园豆:16736 (专家六级) | 2012-08-07 09:19
1
productPic.Split(new[] { "JPG" }, StringSplitOptions.None);
收获园豆:1
水牛刀刀 | 园豆:6350 (大侠五级) | 2012-08-07 09:19
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册