Last active
March 18, 2025 14:19
-
-
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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
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