从网格行中的字符串中删除字符串 [英] Remove a string from a string in grid row

查看:115
本文介绍了从网格行中的字符串中删除字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I ahve a string "10.25 POLYSTER FILM 10.25x0 11gsm 12mic" I have to remove string that has "x"  in the middle of it. Either side of this character there are numbers, and has decimal also there i have to remove it





我尝试了什么:



对于g = 1到VS_Paper_Grid_1.Rows - 1

lLastSlash = InStr(1,VS_Paper_Grid_1.TextMatrix(g,0),x)

如果lLastSlash> 0然后

Paper_Name =左$(VS_Paper_Grid_1.TextMatrix(g,0),2)

Paper_Name =右$(VS_Paper_Grid_1.TextMatrix(g,0),2)



VS_Paper_Grid_1.TextMatrix(g,0)= Paper_Name

lLastSlash1 = InStr(1,Paper_Name,/)

Paper_Name =左$(lLastSlash1,lLastSlash - 1)

结束如果

下一步



What I have tried:

For g = 1 To VS_Paper_Grid_1.Rows - 1
lLastSlash = InStr(1, VS_Paper_Grid_1.TextMatrix(g, 0), "x")
If lLastSlash > 0 Then
Paper_Name = Left$(VS_Paper_Grid_1.TextMatrix(g, 0), 2)
Paper_Name = Right$(VS_Paper_Grid_1.TextMatrix(g, 0), 2)

VS_Paper_Grid_1.TextMatrix(g, 0) = Paper_Name
lLastSlash1 = InStr(1, Paper_Name, "/")
Paper_Name = Left$(lLastSlash1, lLastSlash - 1)
End If
Next

推荐答案

(VS_Paper_Grid_1.TextMatrix(g,0),2)

Paper_Name = Right
(VS_Paper_Grid_1.TextMatrix(g, 0), 2)
Paper_Name = Right


(VS_Paper_Grid_1.TextMatrix(g,0),2)



VS_Paper_Grid_1.TextMatrix(g,0)= Paper_Name

lLastSlash1 = InStr(1,Paper_Name,/)

Paper_Name =左
(VS_Paper_Grid_1.TextMatrix(g, 0), 2)

VS_Paper_Grid_1.TextMatrix(g, 0) = Paper_Name
lLastSlash1 = InStr(1, Paper_Name, "/")
Paper_Name = Left


(lLastSlash1,lLastSlash - 1)

结束如果

下一步
(lLastSlash1, lLastSlash - 1)
End If
Next


这篇关于从网格行中的字符串中删除字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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