Advertisement
6_2008-2009 String Manipulation #199643

String trimmer

Just a little snip of code that lets you trim a specified number of characters from either side of a string.

AI

Tóm tắt bởi AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Mã nguồn
original-source
Function trim_data(data As String, from_left As Integer, from_right As Integer) As String
  'If you try to trim to much, returns an empty string
  If Len(data) <= from_left + from_right Then
    trim_data = ""
  'If not, trim text from sides and return
  Else
    trim_data = Mid(data, from_left + 1, Len(data) - from_left - from_right)
  End If
End Function
Bình luận gốc (3)
Được khôi phục từ Wayback Machine