Pages: [1]   Go Down
Author Topic: Build a String  (Read 605 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: 143
Posts: 9586
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

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Pages: [1]   Go Up
Jump to: