if i have information like this a->b->c->d->MESSAGE,how do i tokenize it such that i get
a,b->c->d->MESSAGE from the original string???????????
well ... if you used a StringTokenizer here, with "->" as separator, you wouldn't. you would get
now ... what exactly do you need? do you need the first token, and to add the rest of the input?
then I would suggest using the indexOf("->") and substring(0, locationOfSeparator)
methods from String to get your reply.
(or, still going on tokenizer, but after you printed your first token, you add "," and then all the other tokens separated by the separator)
i want to divide the string into two halves at the first occurence of the delimiter.i hav to do this repeatedly coz at each stage i hav some processing to do on the remaining part of the string
two parts -> or to halves. that's a huge difference.
if I understand it correctly, your most foreward sollution is, as I first suggested, using the indexOf and substring methods.
but, for further posts, let me give you some advice.
don't just ask for sollutions, provide what you have so we can help you improve it. this may come in the form of a piece of code, or your thoughts on what to use, not just the assignment.
its a small component of a large code,I meant two parts.What i have is a message appended with various mac headers acquired at each router it travels through.at the destination i hav to verify each router by taking the mac's one at a time and verifying with the rest of the message. its in the following form a->b->c->d->message.where a is mac header at the router 'a' b is mac at router 'b' and so on.
yeah, ok. but still, if you know up front the substring used as separator, it's quite .. easy to do this with either the indexOf and substring methods, or by hasMoreTokens and nextToken methods.
just try to write this in code. if you don't know how to start, start with a bit of nasi-schneidermann or pseudo-code, that would make it a lot easier to determine what code to use and in what way to use it. it's a lot easier for us to help you improve your code if we get to see it. you don't have to post the entire application, just the code we need to check for errors.
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Hi. Im using vb 2010. I want to dynamically add textboxes to my form by clicking on a button. I've google searched and so far this code worked:
Private Sub btn_addline_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_addline.Click Dim txtB1 As New TextBox Dim i For i = ...