asp.net - Join Array elements -
i want join array elements string..
i have code
dim qry(3) string dim text string if (textbox1.text <> string.empty) qry(0) = "f_name = '" + textbox1.text + "'" end if if (textbox2.text <> string.empty) qry(1) = "m_name = '" + textbox2.text + "'" end if if (textbox3.text <> string.empty) qry(2) = "l_name = '" + textbox3.text + "'" end if text = string.join(" , ", qry) msgbox(text)
which join array
f_name = 'xyz' , m_name = 'pqr' , l_name = 'abc' and
but want string
f_name = 'xyz' , m_name = 'pqr' , l_name = 'abc'
simply use generic list instead of static array:
dim arrfilters list<string> dim text string if (textbox1.text <> string.empty) arrfilters.add("f_name = '" + textbox1.text + "'") end if if (textbox2.text <> string.empty) arrfilters.add("m_name = '" + textbox2.text + "'") end if if (textbox3.text <> string.empty) arrfilters.add("l_name = '" + textbox3.text + "'") end if text = string.join(" , ", arrfilters)
Comments
Post a Comment