![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
Left, Right, Mid, StrCompDemonstrates the Left, Right, Mid, and StrComp functions.
<% @CodePage = 65001 %>
<% Response.CodePage = 65001 %>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body>
<%
set cks = Server.CreateObject("Chilkat_9_5_0.CkString")
' Left, Right, Mid, StrComp
cks.Str = "123-ABC-XYZ"
' Indexing begins at 0.
' Prints the 3 leftmost characters of the string: 123
Response.Write cks.Left(3) & "<br>"
' Prints the 3 rightmost characters of the string: XYZ
Response.Write cks.Right(3) & "<br>"
' Prints the 3 characters starting at position 4: ABC
Response.Write cks.Mid(4,3) & "<br>"
' StrComp is a string comparison:
' Return 1 for greater than (caller string is lexicographically greater than argument)
' Return 0 for equal.
' Return -1 for less than (caller string is lexicographically less than argument)
cks.Str = "chilkat"
caseSensitive = 0
Response.Write CStr(cks.StrComp("aaa",caseSensitive)) & "<br>"
Response.Write CStr(cks.StrComp("chilkat",caseSensitive)) & "<br>"
Response.Write CStr(cks.StrComp("zzz",caseSensitive)) & "<br>"
%>
</body>
</html>
|
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.