x = StrConv(MidB(StrConv("茵汤____________88.00", vbFromUnicode), 1, 16), vbUnicode) ' = "茵汤____________" x = x & vbCrLf & StrConv(MidB(StrConv("红烧海虎翅一位__288.00", vbFromUnicode), 1, 16), vbUnicode) ' = "红烧海虎翅一位__288.0" Debug.Print x
Option Explicit Dim int_Pos As Integer '读取第一个_ 的位置 Dim strMenu As String Private Sub Command1_Click() Dim strP As String int_Pos = InStr(1, strMenu, "_", vbTextCompare) If int_Pos <= 1 Then Exit Sub strP = Mid(strMenu, 1, int_Pos - 1) Debug.Print strP End SubPrivate Sub Form_Load() strMenu = "茵汤____________88.00" End Sub
x = StrConv(MidB(StrConv("茵汤____________88.00", vbFromUnicode), 1, 16), vbUnicode) ' = "茵汤____________"
x = x & vbCrLf & StrConv(MidB(StrConv("红烧海虎翅一位__288.00", vbFromUnicode), 1, 16), vbUnicode) ' = "红烧海虎翅一位__288.0"
Debug.Print x
Option Explicit
Dim int_Pos As Integer '读取第一个_ 的位置
Dim strMenu As String
Private Sub Command1_Click()
Dim strP As String
int_Pos = InStr(1, strMenu, "_", vbTextCompare)
If int_Pos <= 1 Then Exit Sub
strP = Mid(strMenu, 1, int_Pos - 1)
Debug.Print strP
End SubPrivate Sub Form_Load()
strMenu = "茵汤____________88.00"
End Sub