0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

かっこ内の文字列を消す関数

Last updated at Posted at 2018-12-25
Private Function かっこ内の文字列を消す(Input_St As Variant) As Variant
  Dim Return_St As Variant
  Dim i As Long
  Dim str As String
  Dim write_switch As Long

  write_switch = 0

  For i = 1 To Len(Input_St)
    str = Mid(Input_St, i, 1)
    If str = "<" Or str = "(" Then
      write_switch = write_switch + 1
    End If

    If write_switch = 0 Then
      Return_St = Return_St & str
    End If

    If str = ">" Or str = ")" Then
      write_switch = write_switch - 1
    End If

  Next i

  かっこ内の文字列を消す = Return_St

End Function
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?