Hide minor edits - Show changes to markup
Desde la versión 0.8, esta librería ha sido actualizado usando la API de laLibrería de unión de cadenas, esta
Desde la versión 0.8, esta librería ha sido actualizado usando la API de la Librería de unión de cadenas, esta
Cuando reinicies la aplicación, verás algunos mensajes de advertencia en el panel de depuración que está en la parte inferior de un programaWhen you restart, you'll see a few warning messages in the debugger pane at the bottom of the program. You can ignore them.
There is one significant difference between that version and this one: The Arduino String library contains the function getChars() instead of toCharArray(). The functionality of the two is identical. The name change was made for naming consistency.
This version has been tested with Arduino 0015.
Functions:
Cuando reinicies la aplicación, verás algunos mensajes de advertencia en el panel de depuración que está en la parte inferior del programa los cuales puedes ignorar.
Existe una diferencia entre la esa versión y esta: La librería String de Arduino contiene la función getChars() en vez de la función toCharArray(). El funcionamiento de ambas funciones es el mismo. El nombre se cambió para que existiera coherencia en los nombres.
Esta versión ha sido probada con la versión de la aplicación Arduino 0015.
Funciones:
char charAt(int position) - Returns the character at position
void append(String thisString) - Appends the String representation of thisString. thisString can be and int, long, char, or char array
int capacity() - Returns the internal capacity of the String. This is different from the length.
boolean contains(String thisString) - Returns true if the string contains thisString
byte[] getBytes() - Returns an array of bytes of the String
char[] getChars() - Returns an array of chars of the String
void setCharAt(int positon, char thisChar) - sets the character specified at position to thisChar
boolean endsWith(String thisString) - Returns true if the current string ends with thisString
boolean equals(String thisString) - returns true if the string equals thisString
int indexOf(char thisChar) - Returns the position of the first occurrence of thisChar
int length() - Returns the number of characters in the string
void replace(char thisChar, char thatChar) - Replaces all the occurrences thsChar with thatChar
boolean startsWith(String thisString) - Returns true if the string starts with thisString
String substring(int beginning, int ending) - Returns a substring that begins at beginning position and ends at ending
void toLowerCase() - Converts all the characters to lower case
void toUpperCase() - Converts all the characters to upper case
If anyone's interested in helping to develop this library further, please contact me at tom.igoe at gmail.com
char charAt(int posición) - Devuelve el carácter en posición (argumento de la función)
void append(String estaCadena) - Añade la representación(cadena) estaCadena a otra. estaCadena puede se un entero, long, carácter o array de caracteres
int capacity() - Devuelve la capacidad interna de la cadena. Esto es diferente del número de caracteres de la cadena
boolean contains(String thisString) - Devuelve verdadero si la cadena contiene estaCadena
byte[] getBytes() - Devuelve un array de bytes de la Cadena
char[] getChars() - Devuelve un array de caracteres de la Cadena
void setCharAt(int posicion, char esteCaracter) - cambia el carácter en posicion a esteCaracter
boolean endsWith(String estaCadena) - Devuelve verdadero si la cadena actual acaba con estaCadena
boolean equals(String estaCadena) - Devuelve verdadero si la cadena es igual a estaCadena
int indexOf(char esteCaracter) - Devuelve la posición de la primera coincidencia con esteCaracter
int length() - Devuelve el numero de caracteres de la cadena.
void replace(char esteCaracter, char aquelCaracter) - Sustituye todos los caracteres que coinciden con esteCaracter por aquelCaracter
boolean startsWith(String estaCadena) - Devuelve verdadero si la cadena comienza con estaCadena
String substring(int inicio, int final) - Devuelve una subcadena que comienza en la posición inicio y acaba en la posición final de la cadena que estamos tratando.
void toLowerCase() - Convierte todos los caracteres en minúsculas.
void toUpperCase() - Convierte todos los caracteres en mayúsculas.
Si alguien está interesado en desarrollar aún más esta librería contacte conmigo mediante tom.igoe at gmail.com
Mucho del trabajo en programación se basa enviar y recibir cadenas de texto de datos en ASCII. Aunque Arduino no es una plataforma diseñada para manipulaciones complejas de cadenas de caracteres, hay veces que se necesita leer una cadena o hacer otras operaciones con las mismas. Puede que estés intentando leer datos proveniente de un receptor GPS, o enviando comandos a un transmisor Bluetooth o Zigbee que usa comandos estilo AT. Si eso es lo que intentas hacer, esta librería es para ti.
Mucho del trabajo en programación se basa en enviar y recibir cadenas de texto de datos en ASCII. Aunque Arduino no es una plataforma diseñada para manipulaciones complejas de cadenas de caracteres, hay veces que se necesita leer una cadena o hacer otras operaciones con las mismas. Puede que estés intentando leer datos proveniente de un receptor GPS, o enviando comandos a un transmisor Bluetooth o Zigbee que usa comandos estilo AT. Si eso es lo que intentas hacer, esta librería es para ti.
When you restart, you'll see a few warning messages in the debugger pane at the bottom of the program. You can ignore them.
Cuando reinicies la aplicación, verás algunos mensajes de advertencia en el panel de depuración que está en la parte inferior de un programaWhen you restart, you'll see a few warning messages in the debugger pane at the bottom of the program. You can ignore them.
Desde la versión 0.8, esta librería ha sido actualizado usando la API de laLibrería de unión de cadenas
Desde la versión 0.8, esta librería ha sido actualizado usando la API de laLibrería de unión de cadenas, esta
Mucho del trabajo en programación involucra enviando y recibiendo cadenas de texto de datos en ASCII. Aunque Arduino no es una plataforma diseñada para manipulaciones complejas de cadenas de caracteres, hay veces que se necesita leer una cadena o hacer otras operaciones con las mismas. Yo You might be trying to read a GPS receiver, or sending commands to a Bluetooth or Zigbee radio that uses an AT-style command set. If that's what you're doing, this library is for you.
Download: String.zip
To use, unzip it and copy the resulting folder, called String, into the lib/targets/libraries directory of your arduino application folder. Then re-start the Arduino application.
Mucho del trabajo en programación se basa enviar y recibir cadenas de texto de datos en ASCII. Aunque Arduino no es una plataforma diseñada para manipulaciones complejas de cadenas de caracteres, hay veces que se necesita leer una cadena o hacer otras operaciones con las mismas. Puede que estés intentando leer datos proveniente de un receptor GPS, o enviando comandos a un transmisor Bluetooth o Zigbee que usa comandos estilo AT. Si eso es lo que intentas hacer, esta librería es para ti.
Descarga: String.zip
Para usar, descomprime el archivo y copia los archivos descomprimidos a la carpeta lib/targets/libraries dentro del directorio de la aplicación Arduino. Después reinicia la aplicación.
Desde la versión 0.8, esta librería ha sido actualizado usando la API de laLib
Desde la versión 0.8, esta librería ha sido actualizado usando la API de laLibrería de unión de cadenas
Desde la versión 0.8, esta librería ha sido actualizado usando la API de la[[http://wiring.org.co/learning/reference/String.html|Librfue basada en la versión 0.1 y fue extendida por Hernando Barragan. La descarga de arriba contiene ejemplos adicionales y una versión compatible con Arduino.
Desde la versión 0.8, esta librería ha sido actualizado usando la API de laLib fue basada en la versión 0.1 y fue extendida por Hernando Barragan. La descarga de arriba contiene ejemplos adicionales y una versión compatible con Arduino.
Mucho del trabajo en programación involucra enviando y recibiendo cadenas de texto de datos en ASCII. Aunque Arduino no es una plataforma diseñada para manipulaciones complejas de cadenas de caracteres, hay veces que se necesita leer una cadena, y Altough Arduino isn't designed as a platform for complex manipulation of text strings, there are often times when you need to read strings, look for substrings, compare strings, and so forth. You might be trying to read a GPS receiver, or sending commands to a Bluetooth or Zigbee radio that uses an AT-style command set. If that's what you're doing, this library is for you.
Mucho del trabajo en programación involucra enviando y recibiendo cadenas de texto de datos en ASCII. Aunque Arduino no es una plataforma diseñada para manipulaciones complejas de cadenas de caracteres, hay veces que se necesita leer una cadena o hacer otras operaciones con las mismas. Yo You might be trying to read a GPS receiver, or sending commands to a Bluetooth or Zigbee radio that uses an AT-style command set. If that's what you're doing, this library is for you.
As of version 0.8, this library has been updated using the Wiring String library API. The Wiring library was based on version 0.1 of TextString and extended by Hernando Barragan. The download above contains additional examples and a version compatible with Arduino.
Version 0.8 is a bug fix. There was a memory leak, solved by Mikal Hart. This is an interim release.
A lot of programming work involves sending and receiving strings of ASCII data. Altough Arduino isn't designed as a platform for complex manipulation of text strings, there are often times when you need to read strings, look for substrings, compare strings, and so forth. You might be trying to read a GPS receiver, or sending commands to a Bluetooth or Zigbee radio that uses an AT-style command set. If that's what you're doing, this library is for you.
Desde la versión 0.8, esta librería ha sido actualizado usando la API de la[[http://wiring.org.co/learning/reference/String.html|Librfue basada en la versión 0.1 y fue extendida por Hernando Barragan. La descarga de arriba contiene ejemplos adicionales y una versión compatible con Arduino.
La version 0.8 es la corrección de la versión anterior. Existía una problema con la memoria, solucionado por Mikal Hart. Esta es una publicación provisional.
Mucho del trabajo en programación involucra enviando y recibiendo cadenas de texto de datos en ASCII. Aunque Arduino no es una plataforma diseñada para manipulaciones complejas de cadenas de caracteres, hay veces que se necesita leer una cadena, y Altough Arduino isn't designed as a platform for complex manipulation of text strings, there are often times when you need to read strings, look for substrings, compare strings, and so forth. You might be trying to read a GPS receiver, or sending commands to a Bluetooth or Zigbee radio that uses an AT-style command set. If that's what you're doing, this library is for you.
As of version 0.7, this library has been updated using the Wiring String library API. The Wiring library was based on version 0.1 of TextString and extended by Hernando Barragan. The download above contains additional examples and a version compatible with Arduino.
Version 0.7 is a bug fix. There was a memory leak, solved by Mikal Hart. This is an interim release.
As of version 0.8, this library has been updated using the Wiring String library API. The Wiring library was based on version 0.1 of TextString and extended by Hernando Barragan. The download above contains additional examples and a version compatible with Arduino.
Version 0.8 is a bug fix. There was a memory leak, solved by Mikal Hart. This is an interim release.
As of version 0.4, this library has been updated using the Wiring String library API. The Wiring library was based on version 0.1 of TextString and extended by Hernando Barragan. The download above contains additional examples and a version compatible with Arduino.
As of version 0.7, this library has been updated using the Wiring String library API. The Wiring library was based on version 0.1 of TextString and extended by Hernando Barragan. The download above contains additional examples and a version compatible with Arduino.
Version 0.7 is a bug fix. There was a memory leak, solved by Mikal Hart. This is an interim release.
As of version 0.4, this library has been updated using the Wiring String library API. The Wiring library was based on version 0.1 of TextString and extended by Hernando Barragan. The download above contains additional examples and a version compatible with Arduino.
As of version 0.4, this library has been updated using the Wiring String library API. The Wiring library was based on version 0.1 of TextString and extended by Hernando Barragan. The download above contains additional examples and a version compatible with Arduino.
This version has been tested with Arduino 0013.
This version has been tested with Arduino 0015.
To use, unzip it and copy the resulting folder, called TextString, into the lib/targets/libraries directory of your arduino application folder. Then re-start the Arduino application.
To use, unzip it and copy the resulting folder, called String, into the lib/targets/libraries directory of your arduino application folder. Then re-start the Arduino application.
Functions:
char charAt(int position) - Returns the character at position
void append(String thisString) - Appends the String representation of thisString. thisString can be and int, long, char, or char array
int capacity() - Returns the internal capacity of the String. This is different from the length.
boolean contains(String thisString) - Returns true if the string contains thisString
byte[] getBytes() - Returns an array of bytes of the String
char[] getChars() - Returns an array of chars of the String
void setCharAt(int positon, char thisChar) - sets the character specified at position to thisChar
boolean endsWith(String thisString) - Returns true if the current string ends with thisString
boolean equals(String thisString) - returns true if the string equals thisString
int indexOf(char thisChar) - Returns the position of the first occurrence of thisChar
int length() - Returns the number of characters in the string
void replace(char thisChar, char thatChar) - Replaces all the occurrences thsChar with thatChar
boolean startsWith(String thisString) - Returns true if the string starts with thisString
String substring(int beginning, int ending) - Returns a substring that begins at beginning position and ends at ending
void toLowerCase() - Converts all the characters to lower case
void toUpperCase() - Converts all the characters to upper case
This version has been tested with Arduino 0013.
Download: TextString.zip
To use, unzip it and copy the resulting folder, called TextString, into the lib/targets/libraries directory of your arduino application folder. Then copy the examples folder from the TextString folder to your Arduino code folder (the devault location is Documents/Arduino/). Then re-start the Arduino application.
Download: String.zip
To use, unzip it and copy the resulting folder, called TextString, into the lib/targets/libraries directory of your arduino application folder. Then re-start the Arduino application.
As of version 0.1, this library has very limited functionality. Here's what you can do:
TextString(int strLength) - initialize a TextString of a given length e.g.
TextString myString = TextString(50); // makes a 50-byte long TextString
clear(void) - fill the TextString with zeroes, e.g.
myString.clear(); // clears the string
length(void) - get the length up to the first zero byte e.g.
int stringLength = myString.length(); // gives the string length
equals( char *thatString) - compare your TextString to a given string, e.g.
if (myString.equals("Hello")) {
// compares myString to "Hello"
}
contains(char *subString) - whether the TextString contains a given substring e.g.
if (myString.contains("Hello")) {
// checks if myString contains the subString "Hello"
}
trim(void) - trim whitespace from both ends of the TextString. Removes any space characters, carriage returns, newlines, tabs, or vertical tabs. e.g.
Serial.print(myString.trim()); // prints the trimmed version of myString
trimRight(void) - trim whitespace from the end of the TextString e.g.
Serial.print(myString.trimRight()); // prints the version of myString trimmed on the end
trimLeft(void) - trim whitespace from the beginning of the TextString e.g.
Serial.print(myString.trimLeft()); // prints the version of myString trimmed from the beginning
setArray(char* thatString) - set the whole character array e.g.
myString.setArray("What's up Doc?"); // puts a string in the array
getArray(void) - get the whole character array e.g.
Serial.println(myString.getArray()); // prints the string
getCharAt(int charNum) - get a given character from the TextString e.g.
char thisChar = myString.getCharAt(5); // gets the sixth character in the array
setCharAt(int charNum, char thisChar) - set a given charracter in the TextString e.g.
myString.setCharAt(5, 'A'); // sets the sixth character in the array to "A"
version(void) - get the library version. Since there will be more functions added, printing the version is a useful debugging tool when you get an error from a given function. Perhaps you're using an earlier version that doesn't feature the version you need! e.g.
Serial.println(myString.version()); // prints the version of the library
As of version 0.4, this library has been updated using the Wiring String library API. The Wiring library was based on version 0.1 of TextString and extended by Hernando Barragan. The download above contains additional examples and a version compatible with Arduino.
There is one significant difference between that version and this one: The Arduino String library contains the function getChars() instead of toCharArray(). The functionality of the two is identical. The name change was made for naming consistency.
Serial.print(myString.trim); // prints the trimmed version of myString
Serial.print(myString.trim()); // prints the trimmed version of myString
Serial.print(myString.trimRight); // prints the version of myString trimmed on the end
Serial.print(myString.trimRight()); // prints the version of myString trimmed on the end
Serial.print(myString.trimLeft); // prints the version of myString trimmed from the beginning
Serial.print(myString.trimLeft()); // prints the version of myString trimmed from the beginning
To use it download TextString.zip. Unzip it, and copy the resulting folder, called TextString, into the lib/targets/libraries directory of your arduino application folder. Then copy the examples folder from the TextString folder to your Arduino code folder (the devault location is Documents/Arduino/). Then re-start the Arduino application.
Download: TextString.zip
To use, unzip it and copy the resulting folder, called TextString, into the lib/targets/libraries directory of your arduino application folder. Then copy the examples folder from the TextString folder to your Arduino code folder (the devault location is Documents/Arduino/). Then re-start the Arduino application.
if (myString.equals("Hello") {
if (myString.equals("Hello")) {
if (myString.contains("Hello") {
if (myString.contains("Hello")) {
To use it download . Unzip it, and copy the resulting folder, called TextString, into the lib/targets/libraries directory of your arduino application folder. Then copy the examples folder from the TextString folder to your Arduino code folder (the devault location is Documents/Arduino/). Then re-start the Arduino application.
To use it download TextString.zip. Unzip it, and copy the resulting folder, called TextString, into the lib/targets/libraries directory of your arduino application folder. Then copy the examples folder from the TextString folder to your Arduino code folder (the devault location is Documents/Arduino/). Then re-start the Arduino application.
To use it download TextString.zip. Unzip it, and copy the resulting folder, called TextString, into the lib/targets/libraries directory of your arduino application folder. Then copy the examples folder from the TextString folder to your Arduino code folder (the devault location is Documents/Arduino/). Then re-start the Arduino application.
To use it download . Unzip it, and copy the resulting folder, called TextString, into the lib/targets/libraries directory of your arduino application folder. Then copy the examples folder from the TextString folder to your Arduino code folder (the devault location is Documents/Arduino/). Then re-start the Arduino application.
getArray(char* thatString) - set the whole character array e.g.
setArray(char* thatString) - set the whole character array e.g.
If anyone's interested in helping to develop this library further, please contact me at tom.igoe at gmail.com
length(void) - get the length up to the first zero e.g.
length(void) - get the length up to the first zero byte e.g.
getArray(void) - get the whole character array e.g.
getArray(char* thatString) - set the whole character array e.g.
Serial.println(myString.getArray()); // prints the string
myString.setArray("What's up Doc?"); // puts a string in the array
getCharAt(int charNum) - get a given character from the TextString e.g.
getArray(void) - get the whole character array e.g.
char thisChar = myString.getCharAt(5); // gets the sixth character in the array
Serial.println(myString.getArray()); // prints the string
setCharAt(int charNum, char thisChar) - set a given charracter in the TextString e.g.
getCharAt(int charNum) - get a given character from the TextString e.g.
myString.setCharAt(5, 'A'); // sets the sixth character in the array to "A"
char thisChar = myString.getCharAt(5); // gets the sixth character in the array
version(void) - get the library version. Since there will be more functions added, printing the version is a useful debugging tool when you get an error from a given function. Perhaps you're using an earlier version that doesn't feature the version you need! e.g.
setCharAt(int charNum, char thisChar) - set a given charracter in the TextString e.g.
Serial.println(myString.version()); // prints the version of the library
myString.setCharAt(5, 'A'); // sets the sixth character in the array to "A"
version(void) - get the library version. Since there will be more functions added, printing the version is a useful debugging tool when you get an error from a given function. Perhaps you're using an earlier version that doesn't feature the version you need! e.g.
Serial.println(myString.version()); // prints the version of the library
length(void) - get the length up to the first zero
e.g.
length(void) - get the length up to the first zero e.g.
contains(char *subString) - whether the TextString contains a given substring
e.g.
contains(char *subString) - whether the TextString contains a given substring e.g.
trim(void) - trim whitespace from both ends of the TextString. Removes any space characters, carriage returns, newlines, tabs, or vertical tabs.
e.g.
trim(void) - trim whitespace from both ends of the TextString. Removes any space characters, carriage returns, newlines, tabs, or vertical tabs. e.g.
trimRight(void) - trim whitespace from the end of the TextString
e.g.
trimRight(void) - trim whitespace from the end of the TextString e.g.
trimLeft(void) - trim whitespace from the beginning of the TextString
e.g.
trimLeft(void) - trim whitespace from the beginning of the TextString e.g.
getArray(void) - get the whole character array
e.g.
getArray(void) - get the whole character array e.g.
getCharAt(int charNum) - get a given character from the TextString
e.g.
getCharAt(int charNum) - get a given character from the TextString e.g.
setCharAt(int charNum, char thisChar) - set a given charracter in the TextString
e.g.
setCharAt(int charNum, char thisChar) - set a given charracter in the TextString e.g.
version(void) - get the library version. Since there will be more functions added, printing the version is a useful debugging tool when you get an error from a given function. Perhaps you're using an earlier version that doesn't feature the version you need!
e.g.
version(void) - get the library version. Since there will be more functions added, printing the version is a useful debugging tool when you get an error from a given function. Perhaps you're using an earlier version that doesn't feature the version you need! e.g.
trim(void) - trim whitespace from both ends of the TextString
trim(void) - trim whitespace from both ends of the TextString. Removes any space characters, carriage returns, newlines, tabs, or vertical tabs.
Serial.print(myString.trim); // prints the version of myString with no spaces, returns, or newlines on either end
Serial.print(myString.trim); // prints the trimmed version of myString
Serial.print(myString.trimRight); // prints the version of myString with no spaces, returns, or newlines on the end
Serial.print(myString.trimRight); // prints the version of myString trimmed on the end
Serial.print(myString.trimLEft); // prints the version of myString with no spaces, returns, or newlines at the beginning
Serial.print(myString.trimLeft); // prints the version of myString trimmed from the beginning
equals( char *thatString) - compare your TextString to a given string, e.g.
if (myString.equals("Hello") {
// compares myString to "Hello"
}
int stringLength = myString.length(); // gives the string length
contains(char *subString) - whether the TextString contains a given substring
e.g.
equals( char *thatString) - compare your TextString to a given string, e.g.
if (myString.contains("Hello") {
// checks if myString contains the subString "Hello"
if (myString.equals("Hello") {
// compares myString to "Hello"
trim(void) - trim whitespace from both ends of the TextString
contains(char *subString) - whether the TextString contains a given substring
Serial.print(myString.trim); // prints the version of myString with no spaces, returns, or newlines on either end
if (myString.contains("Hello") {
// checks if myString contains the subString "Hello"
}
trimRight(void) - trim whitespace from the end of the TextString
trim(void) - trim whitespace from both ends of the TextString
Serial.print(myString.trimRight); // prints the version of myString with no spaces, returns, or newlines on the end
Serial.print(myString.trim); // prints the version of myString with no spaces, returns, or newlines on either end
trimLeft(void) - trim whitespace from the beginning of the TextString
trimRight(void) - trim whitespace from the end of the TextString
Serial.print(myString.trimLEft); // prints the version of myString with no spaces, returns, or newlines at the beginning
Serial.print(myString.trimRight); // prints the version of myString with no spaces, returns, or newlines on the end
getArray(void) - get the whole character array
trimLeft(void) - trim whitespace from the beginning of the TextString
Serial.println(myString.getArray()); // prints the string
Serial.print(myString.trimLEft); // prints the version of myString with no spaces, returns, or newlines at the beginning
getCharAt(int charNum) - get a given character from the TextString
getArray(void) - get the whole character array
char thisChar = myString.getCharAt(5); // gets the sixth character in the array
Serial.println(myString.getArray()); // prints the string
setCharAt(int charNum, char thisChar) - set a given charracter in the TextString
getCharAt(int charNum) - get a given character from the TextString
myString.setCharAt(5, 'A'); // sets the sixth character in the array to "A"
char thisChar = myString.getCharAt(5); // gets the sixth character in the array
version(void) - get the library version. Since there will be more functions added, printing the version is a useful debugging tool when you get an error from a given function. Perhaps you're using an earlier version that doesn't feature the version you need!
setCharAt(int charNum, char thisChar) - set a given charracter in the TextString
Serial.println(myString.version()); // prints the version of the library
myString.setCharAt(5, 'A'); // sets the sixth character in the array to "A"
version(void) - get the library version. Since there will be more functions added, printing the version is a useful debugging tool when you get an error from a given function. Perhaps you're using an earlier version that doesn't feature the version you need!
e.g.
Serial.println(myString.version()); // prints the version of the library
clear(void) - fill the TextString with zeroes
clear(void) - fill the TextString with zeroes, e.g.
myString.clear(); // clears the string
if (myString.equals("Hello") {
// compares myString to "Hello"
}
if (myString.contains("Hello") {
// checks if myString contains the subString "Hello"
}
Serial.print(myString.trim); // prints the version of myString with no spaces, returns, or newlines on either end
Serial.print(myString.trimRight); // prints the version of myString with no spaces, returns, or newlines on the end
Serial.print(myString.trimLEft); // prints the version of myString with no spaces, returns, or newlines at the beginning
Serial.println(myString.getArray()); // prints the string
char thisChar = myString.getCharAt(5); // gets the sixth character in the array
version(void) - get the library version
myString.setCharAt(5, 'A'); // sets the sixth character in the array to "A"
version(void) - get the library version. Since there will be more functions added, printing the version is a useful debugging tool when you get an error from a given function. Perhaps you're using an earlier version that doesn't feature the version you need!
Serial.println(myString.version()); // prints the version of the library
e.g.
TextString(int strLength) - initialize a TextString of a given length e.g.
clear(void) - fill the TextString with zeroes
equals( char *thatString) - compare your TextString to a given string, e.g. length(void) - get the length up to the first zero
contains(char *subString) - whether the TextString contains a given substring
trim(void) - trim whitespace from both ends of the TextString
trimRight(void) - trim whitespace from the end of the TextString
trimLeft(void) - trim whitespace from the beginning of the TextString
getArray(void) - get the whole character array
getCharAt(int charNum) - get a given character from the TextString
setCharAt(int charNum, char thisChar) - set a given charracter in the TextString
version(void) - get the library version
TextString myString = TextString(50); // makes a 50-byte long TextString clear(void); // fill the TextString with zeroes
int equals( char *thatString); // compare to a given string
int length(void); // get the length up to the first zero
int contains(char *subString); // whether the string contains the substring
char* trim(void); // trim whitespace
char* trimRight(void); // trim whitespace from the end
char* trimLeft(void); // trim whitespace from the beginning
char* getArray(void); // get the whole char array
char getCharAt(int charNum); // get a given char
void setCharAt(int charNum, char thisChar); // set a given char
char* version(void); // get the library version
TextString myString = TextString(50); // makes a 50-byte long TextString
e.g.
e.g.
e.g.
e.g.
e.g.
e.g.
e.g.
e.g.
e.g.
e.g. TextString myString = TextString(50); // makes a 50-byte long TextString clear(void); // fill the TextString with zeroes
int equals( char *thatString); // compare to a given string
int length(void); // get the length up to the first zero
int contains(char *subString); // whether the string contains the substring
char* trim(void); // trim whitespace
char* trimRight(void); // trim whitespace from the end
char* trimLeft(void); // trim whitespace from the beginning
char* getArray(void); // get the whole char array
char getCharAt(int charNum); // get a given char
void setCharAt(int charNum, char thisChar); // set a given char
char* version(void); // get the library version
To use it download TextString.zip. Unzip it, and copy the resulting folder, called TextString, into the lib/targets/libraries directory of your arduino application folder. Then copy the examples folder from the TextString folder to your Arduino code folder (the devault location is Documents/Arduino/). Then re-start the Arduino application.
To use it download TextString.zip. Unzip it, and copy the resulting folder, called TextString, into the lib/targets/libraries directory of your arduino application folder. Then copy the examples folder from the TextString folder to your Arduino code folder (the devault location is Documents/Arduino/). Then re-start the Arduino application.
A lot of programming work involves sending and receiving strings of ASCII data. For example, the exchange between a web browser and a web server involves escanges like this:
Altough Arduino isn't designed as a platform for complex manipulation of text strings, there are often times
A lot of programming work involves sending and receiving strings of ASCII data. Altough Arduino isn't designed as a platform for complex manipulation of text strings, there are often times when you need to read strings, look for substrings, compare strings, and so forth. You might be trying to read a GPS receiver, or sending commands to a Bluetooth or Zigbee radio that uses an AT-style command set. If that's what you're doing, this library is for you.
To use it download TextString.zip. Unzip it, and copy the resulting folder, called TextString, into the lib/targets/libraries directory of your arduino application folder. Then copy the examples folder from the TextString folder to your Arduino code folder (the devault location is Documents/Arduino/). Then re-start the Arduino application.
When you restart, you'll see a few warning messages in the debugger pane at the bottom of the program. You can ignore them.
As of version 0.1, this library has very limited functionality. Here's what you can do:
A lot of programming work involves sending and receiving strings of ASCII data. For example, the exchange between a web browser and a web server involves escanges like this:
Altough Arduino isn't designed as a platform for complex manipulation of text strings, there are often times