Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


StrCmp

Compares two UTF-8 buffers for relative equality.
Read time 2 minutesLast updated 13 days ago

Definition

  • Type: Method
  • Namespace: Unity.Collections
  • Assembly: UnityEngine.ManagedKernelModule

StrCmp(byte*, int, byte*, int)

Compares two UTF-8 buffers for relative equality.
public static int StrCmp(byte* utf8BufferA, int utf8LengthInBytesA, byte* utf8BufferB, int utf8LengthInBytesB)

Parameters

utf8BufferA

The first buffer of UTF-8 text.

utf8LengthInBytesA

The length in bytes of the first UTF-8 buffer.

utf8BufferB

The second buffer of UTF-8 text.

utf8LengthInBytesB

The length in bytes of the second UTF-8 buffer.

Returns

Type

Description

intLess than zero if first different code point is less in the first UTF-8 buffer. Zero if the strings are identical. More than zero if first different code point is less in the second UTF-8 buffer.

StrCmp(char*, int, char*, int)

Compares two UTF-16 buffers for relative equality.
public static int StrCmp(char* utf16BufferA, int utf16LengthInCharsA, char* utf16BufferB, int utf16LengthInCharsB)

Parameters

utf16BufferA

The first buffer of UTF-16 text.

utf16LengthInCharsA

The length in chars of the first UTF-16 buffer.

utf16BufferB

The second buffer of UTF-16 text.

utf16LengthInCharsB

The length in chars of the second UTF-16 buffer.

Returns

Type

Description

intLess than zero if first different code point is less in the first UTF-16 buffer. Zero if the strings are identical. More than zero if first different code point is less in the second UTF-16 buffer.

StrCmp(byte*, int, char*, int)

Compares a UTF-8 buffer and a UTF-16 buffer for relative equality.
public static int StrCmp(byte* utf8Buffer, int utf8LengthInBytes, char* utf16Buffer, int utf16LengthInChars)

Parameters

utf8Buffer

The buffer of UTF-8 text.

utf8LengthInBytes

The length in bytes of the UTF-8 buffer.

utf16Buffer

The buffer of UTF-16 text.

utf16LengthInChars

The length in chars of the UTF-16 buffer.

Returns

Type

Description

intLess than zero if first different code point is less in UTF-8 buffer. Zero if the strings are identical. More than zero if first different code point is less in UTF-16 buffer.

StrCmp(char*, int, byte*, int)

Compares a UTF-16 buffer and a UTF-8 buffer for relative equality.
public static int StrCmp(char* utf16Buffer, int utf16LengthInChars, byte* utf8Buffer, int utf8LengthInBytes)

Parameters

utf16Buffer

The buffer of UTF-16 text.

utf16LengthInChars

The length in chars of the UTF-16 buffer.

utf8Buffer

The buffer of UTF-8 text.

utf8LengthInBytes

The length in bytes of the UTF-8 buffer.

Returns

Type

Description

intLess than zero if first different code point is less in UTF-16 buffer. Zero if the strings are identical. More than zero if first different code point is less in UTF-8 buffer.