Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Arrays

Status
Not open for further replies.

claforet

Mechanical
Apr 8, 2010
54
Does anyone know a command to convert a string array to a single string (I am passing the file path to the run_journal.exe program and I need to make the array of strings into a single string).

Thanks.
 
Replies continue below

Recommended for you

What language?
Some pseudocode might be something like this?

Code:
superstring = ""
for i = 0 to ubound(strarray)
superstring = superstring & strarray(i)
next
 
If you are talking tcl which if you are in UGS you might be, you could try something like this. This does work, you will get a long string, but the order in which it appends is somewhat hazy. So if the order in which the variables are added to the string, this should work.

foreach {index value} [array get myarray] {
if {![info exists stringvar]} {
set stringvar $value
} else {
append stringvar $value
}
} ;# foreach
 
Sorry didn't notice that you said it was a path so order would be important.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor