Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

spaces spaces

Status
Not open for further replies.

cjkenworthy

Programmer
Sep 13, 2002
237
GB
In a loop I need to: read in an array element(I) to a variable, remove all spaces and add ' ' around the value using the following code:

for I=0 to Ubound(NGNarray, 1)

dim strCurrTERMNO
dim strCurrNGN

strCurrTERMNO = TERMNOarray(I)
strCurrNGN = NGNarray(I)

Trim(strCurrTERMNO)
Trim(strCurrNGN)

'Works fine up to here, variables hold array element(I)

strCurrTERMNO = ("'" & strCurrTERMNO & "'")
strCurrNGN = ("'" & strCurrNGN & "'")

'but now variables hold eg '_2222222' where _ is whitespace.

next

how would I simply get the variable to hold 'value' without the mysterious spaces ('_value') appearing after the first ' ?

So I wish to have: eg. '2222222'
BUT I get: eg. ' 2222222'


any tips?

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top