user31547: with the following code:
int foo = bar[1].toInt;

or
int foo = bar[1].toInt();

I get this error
request for member 'toInt' in '*(bar + 1u)', which is of non-class type 'uint8_t {aka unsigned char}'

the context for this is bar is the response from a HTTP client over web sockets

user10394: I'm not quite clean on what you are trying to do.  So lets assume the String has "abc123" in and you want the numeric part.
const String input = "abc123";
const int foo = input.toInt();  // This will not work!    

const String input = "abc123";
const String tmp = input.substring(3); // Take the end of the string
const int foo = input.toInt();  // foo == 123

const String input = "abc123";
const String tmp = input.substring(3,4); // Take the end of the string
const int foo = input.toInt();  // foo == 1 or 12 (can't quite tell from the docs)

Is one of those what you want to do?
You can't take a character and then apply a function from the string class to it without making it a String first.
int foo = String(bar[1]).toInt();  // This should work


user31717: The Arduino function toInt requires a String object.
You're passing it a single character, not a String.
int foo = String(bar[1]).toInt();


31547: <p>with the following code:</p>

<pre><code>int foo = bar[1].toInt;
</code></pre>

<p>or</p>

<pre><code>int foo = bar[1].toInt();
</code></pre>

<p>I get this error</p>

<pre><code>request for member 'toInt' in '*(bar + 1u)', which is of non-class type 'uint8_t {aka unsigned char}'
</code></pre>

<p>the context for this is bar is the response from a HTTP client over web sockets</p>
 10394: <p>I'm not quite clean on what you are trying to do.  So lets assume the String has "abc123" in and you want the numeric part.</p>

<pre><code>const String input = "abc123";
const int foo = input.toInt();  // This will not work!    

const String input = "abc123";
const String tmp = input.substring(3); // Take the end of the string
const int foo = input.toInt();  // foo == 123

const String input = "abc123";
const String tmp = input.substring(3,4); // Take the end of the string
const int foo = input.toInt();  // foo == 1 or 12 (can't quite tell from the docs)
</code></pre>

<p>Is one of those what you want to do?</p>

<p>You can't take a character and then apply a function from the string class to it without making it a String first.</p>

<pre><code>int foo = String(bar[1]).toInt();  // This should work
</code></pre>
 31717: <p>The Arduino function <code>toInt</code> requires a <code>String</code> object.
You're passing it a single character, not a <code>String</code>.</p>

<pre><code>int foo = String(bar[1]).toInt();
</code></pre>
