@SuppressWarnings("PatternValidation") // impossible to validate since the character is variable
  static @NotNull Key key(final @NotNull String string, final char character) {
    final int index = string.indexOf(character);
    final String namespace = index >= 1 ? string.substring(0, index) : MINECRAFT_NAMESPACE;
    final String value = index >= 0 ? string.substring(index + 1) : string;
    return key(namespace, value);
  }
Creates a key.

<p>This will parse {@code string} as a key, using {@code character} as a separator between the namespace and the value.</p>

<p>The namespace is optional. If you do not provide one (for example, if you provide {@code player} or {@code character + "player"}
as the string) then {@link #MINECRAFT_NAMESPACE} will be used as a namespace and {@code string} will be used as the value,
removing the provided separator character if necessary.</p>

@param string the string
@param character the character that separates the namespace from the value
@return the key
@throws InvalidKeyException if the namespace or value contains an invalid character
@since 4.0.0
key/src/main/java/net/kyori/adventure/key/Key.java