Edit

Share via


StringExtensions.ToVector2(String) Method

Definition

Converts a String value to a Vector2 value. This method always assumes the invariant culture for parsing values (',' separates numbers, '.' is the decimal separator). The input text can either represents a single number (mapped to Vector2(Single), or multiple components. Additionally, the format "<float, float>" is also allowed (though less efficient to parse).

public static System.Numerics.Vector2 ToVector2 (this string text);
static member ToVector2 : string -> System.Numerics.Vector2
<Extension()>
Public Function ToVector2 (text As String) As Vector2

Parameters

text
String

A String with the values to parse.

Returns

The parsed Vector2 value.

Exceptions

Thrown when text doesn't represent a valid Vector2 value.

Applies to