rather stupid array problem
ok im doing something very simple<BR><BR>returnarray = split(ch, " ")<BR>rconnumb = returnarray(2)<BR><BR>no i then form a string to send off to a remote server<BR><BR>string = "rcon " & rconnumb & " ""test"" ""info"" "<BR><BR>all seems fine at first however that string being created isnt all it appears to be<BR><BR>it is in fact <BR>rcon 12345667889
is stored in the rconnumb variable and is somehow created in teh array split i need to remove it so the string becomes all on one line<BR>so i need<BR>rcon 12345667889 "test" "info"<BR><BR>ive tried replace(rconnumb, "
", "")<BR>and also a replace using vbCRLF<BR><BR>none of them remove this
ive also tried a trim and left etc etc and its still there.<BR><BR>any suggestions *** to how to remove this annoying carrige return would be muchly appreciated
Where is it coming from?
what is CH? the carriage return must be in ch. A split function doesn't just add one.
RE: rather stupid array problem
your array here<BR>returnarray = split(ch, " ")<BR>rconnumb = returnarray(2)<BR><BR><BR>Can you give more detail of what the origional values are in the array<BR><BR>then tell us what you need to do with it.<BR><BR>But would like to see the origional coding that builds the array and what the values are<BR><BR>just to see exactly what you are doing/tring to do.<BR><BR>I did this as a test.<BR><BR>rconnumb = "12321273"<BR>strST = "rcon " & rconnumb & " ""test"" ""info"" "<BR>Response.Write strST<BR><BR>And the result was<BR>rcon 12321273 "test" "info" <BR><BR>Didn't have the
in it...<BR><BR>So must have something to do with the values and the way you are handling them.<BR><BR>Russell M
is *NOT* vbCRLF
is *NOT* vbCRLF
Im Currious about this.<BR><BR>vbLF is a standard space is it not? " "<BR>He said
is stored in the rconnumb variable and is somehow created in the array split.<BR>(Maybe the way he's handling it)<BR><BR>The output is an integer 12345667889
<BR>But with the
tacked onto the end.<BR><BR>Where exactly does the
come from?<BR><BR>If it is the space in the array being converted somehow...<BR><BR>And if he's knows what element of the array he wants<BR>returnarray(2)<BR><BR>Why not this<BR>rconnumb = returnarray(2)<BR>Which should only return the value of rconnumb = 12345667889<BR>Without the
in it.<BR><BR>Have i got this all Back@sswards again?<BR><BR>I feel a tsk, tsk Russell coming....<BR><BR>Russell M<BR>
LF means 'Line Feed'
This all goes back to the days of TeleTypes! Even pre-computer, in other words.<BR><BR>You could type a line on a TeleType machine and then hit *JUST* the "CR" (Carriage Return) key to send the head back to the left side of the paper *WITHOUT* advancing the paper. Then you could type on top of the characters already on the line! You would do this to make the letters bolder (hit the same letter again), to underline them, to build special characters (e.g., hit "e" the first time and then "'" the next time, to make an accented "e").<BR><BR>To go to the next line, you had to push the "LF" (Line Feed) key.<BR><BR>To start a new line, then you had to hit *BOTH* the CR and the LF keys.<BR><BR>Since Microsoft BASIC ("MicroSoft", at the time) originally was designed for the very first microcomputers and about the only keyboard and output devices that were available to hobbyists wer TeleType machines (used, refurbished ASR-33 teletypes went for $1000 to $1500...they could print 10 characters per second), naturally MS BASIC had to support CR and LF. And that's where it all started!<BR><BR>Actually, the early UNIX machines *also* used the same TeleType machines, but somebody early on in the Unix history decided that the "drivers" for the TeleTypes could accept just LF to mean "send both CR and LF to the machine". Since MS BASIC was written before operating systems for microcomputers existed, there weren't any such things as "drivers." Anyway, the result is that in the Unix world today, text files have *ONLY* a "newline" character between lines. And that "newline" character is...what else?...the good old LF from TeleType days!<BR><BR>And the PC, still today, uses *both* CR and LF between lines of a text file. (Though almost all text utilities today will handle files that have only LF's. MS Word has done so for a long time. WordPad, too. NotePad didn't up until XP...since it changed so much in XP, I dunno if that has changed, too. But when you create a text file...yep, still you get CR and LF between lines. So you could still print that page on a TeleType.)<BR><BR><BR>
And I dunno...
...how he is getting the vbLF (LineFeed, or
" in there.<BR><BR>Who knows? But it's easy to get rid of.<BR><BR>
...he is getting input from a <TEXTAREA>, and when you put a linebreak in the <TEXTAREA> you get the
???<BR><BR>Ehhh...maybe he'll come back some year and tell us.<BR><BR>
couldnt find it
i tried everything but no go.<BR><BR>1st tho,<BR>I tried what you talked about (just to understand more) like this<BR>Response.Write "12321333" & vbLF & "4444543545"<BR>output = 12321333 4444543545<BR>Using just LF<BR>Response.Write "12321333" & vbLF & "4444543545"<BR>then no space, 123213334444543545<BR><BR>Hard to grasp it.<BR>Back to his prob.<BR><BR>I tried an array from text boxes, and text areas, (not js) but vbs<BR><BR>I Could not get the
he was getting.<BR><BR>But like you said who knows how he built the array or where it came from...<BR><BR>Figured i would try as much as i could to satify my curriosity, would be faster than waiting for him to come back...<BR>LOL<BR><BR>Oh well.<BR>Bed time.<BR>Nite & cya soon.<BR><BR>Russell M
That was awesome! <eop>