Loading...
Pages: [1]   Go Down
Author Topic: Build a String  (Read 362 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 1
Posts: 146
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey Guys,

Do any of you guys know how to build a String? What i am trying to do is to read a number from the Serial port, and add it to String constants.
For example, I need to have "<T1*>" as a resulting string. The number can change however. So if I send the number 2 to the Serial port, the resulting String should be "<T2*>".

What is the best way to do this?

Thanks!
Logged

0
Offline Offline
Tesla Member
***
Karma: 50
Posts: 6536
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The below has some good info on manipulating strings. StringReplace might be an easy approach.

http://arduino.cc/en/Reference/StringObject
Logged

Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
GOOGLE ADVANCED FORUM SEARCH BELOW!  
Go to:  http://www.google.com/advanced_search?hl=en
put in key search words,
use site or domain:  http://arduino.cc/forum
or in a google search box put key words site:http://arduino.cc/forum

Pages: [1]   Go Up
Print
 
Jump to: