Table of Contents

Method GetStringPrefixLength

Namespace
DSharpPlus.CommandsNext
Assembly
DSharpPlus.CommandsNext.dll

GetStringPrefixLength(DiscordMessage, string, StringComparison)

Checks whether the message has a specified string prefix.

public static int GetStringPrefixLength(this DiscordMessage msg, string str, StringComparison comparisonType = StringComparison.Ordinal)

Parameters

msg DiscordMessage

Message to check.

str string

String to check for.

comparisonType StringComparison

Method of string comparison for the purposes of finding prefixes.

Returns

int

Positive number if the prefix is present, -1 otherwise.