Skip to content

Instantly share code, notes, and snippets.

@R0mb0
Last active March 18, 2025 14:19
Show Gist options
  • Save R0mb0/9ba27fccdae120ba5b167da9637b2d21 to your computer and use it in GitHub Desktop.
Save R0mb0/9ba27fccdae120ba5b167da9637b2d21 to your computer and use it in GitHub Desktop.
Function in Classic ASP to print a part of a string delimited by indices . -> `Code generated with Copilot`
<%
Function substringFromIndices(String, startIndex, endIndex)
Dim resultString
' Validate indices
If startIndex < 1 Then
startIndex = 1
End If
If endIndex > Len(String) Then
endIndex = Len(String)
End If
If startIndex > endIndex Then
resultString = ""
Else
resultString = Mid(String, startIndex, endIndex - startIndex + 1)
End If
substringFromIndices = resultString
End Function
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment