IndexOf missing first character

Well, as the title says really!

 if (Tosend.indexOf("X")>0){
        Serial.println("X axis has been selected");
        Axis_val=(Tosend.indexOf("X"));                                                                                                                               
        Serial.println(Axis_val);
 }

It finds the X and returns the position as I require, unless the X is the first letter in the string.
How do I make it check the first character in the string? (Yes... I know strings are evil).

Specifying a start point (Tosend.indexOf("X",0)>0) didn't work either

Zero is never greater than zero.

strings are not evil, but Strings are.

The index of the first element of an array = 0.

'Insert head banging icon here'

indexOf()
Locates a character or String within another String. By default, searches from the beginning of the String, but can also start from a given index, allowing for the locating of all instances of the character or String.

Syntax
myString.indexOf(val)
myString.indexOf(val, from)

Parameters
myString: a variable of type String.
val: the value to search for. Allowed data types: char, String.
from: the index to start the search from.

Returns
The index of val within the String, or -1 if not found.

So... now that problem is fixed...

How do I retrieve, and convert numbers from a string into a variable.

Test="Hello123";

How do I get the '123' out of that string, and convert it into a variable?

The string varies in length, but the numbers are usually at the end of the string.

String foo = "Hello123";

int m = foo.toInt();

or

double n = foo.toDouble();

Thank you. With some tweaking, that works.

numbers from a string

A string is a null terminated character array. A String is an object of the String class. Not to be pedantic, but they are not the same and the terms can not be used interchangeably.