Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... 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-2024 Chilkat Software, Inc. All Rights Reserved.