Advertisement
ASP_Volume2 String Manipulation #31580

Variation of Paul Leyten's Path Clipper thing.

splits a path up a path and shortens parts to make it shorter. e.g. c:\program files\blingblongblu\bah\bleh.exe c:\program...\blingbl...\bah\bleh.exe

AI

Resumo por IA: 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.

Código fonte
original-source
Private Function ShortenPath(Path As String, MaxLen As Integer) As String
Dim bleh() As String
bleh = Split(Path, "\")
For x = 0 To UBound(bleh)
  If Not x = UBound(bleh) Then
    If Len(bleh(x)) > MaxLen Then
      bleh(x) = Mid$(bleh(x), 1, MaxLen - 3) & "..."
    End If
    tmp = tmp & bleh(x) & "\"
  Else
    tmp = tmp & bleh(x)
  End If
Next
ShortenPath = tmp
End Function
Comentários originais (3)
Recuperado do Wayback Machine