Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-07-2008, 09:48 AM
Member
 
Join Date: Oct 2008
Posts: 3
Rep Power: 0
joka22 is on a distinguished road
Default Array issues
Hi everybody,
I'm first time on that forum. I have a question.
Let's say I have an array

Code:
String[] msgs;
System.out.println("posx1 = " + msgs[0]);
System.out.println("posx2 = " + msgs[1]);
I got the following message:

MSG(TAG): tagid=10, posx=83, posy=55
MSG(TAG): tagid=11, posx=22, posy=12

How can I get just the number for posx and posy from that array? Any idea?
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 10-07-2008, 10:00 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 6,523
Rep Power: 9
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
So you get two strings there. So what you have to do is, sub string the original one or use regular expression.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Someone helped you?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.
Help:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Resources:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Web:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Tips:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 10-07-2008, 10:03 AM
Senior Member
 
Join Date: Sep 2008
Posts: 607
Rep Power: 1
Darryl.Burke is on a distinguished road
Default
Parse the String using indexOf and substring and Integer.parseInt.

db
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 10-07-2008, 10:04 AM
Member
 
Join Date: Oct 2008
Posts: 3
Rep Power: 0
joka22 is on a distinguished road
Default
OK, but what do you mean by regular expression?
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 10-07-2008, 10:17 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 6,523
Rep Power: 9
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Regular expression is kind of a way that syntactically analyzed elements used to match patterns of text
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Someone helped you?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.
Help:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Resources:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Web:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Tips:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 10-07-2008, 10:53 AM
Senior Member
 
Join Date: Sep 2008
Posts: 607
Rep Power: 1
Darryl.Burke is on a distinguished road
Default
Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes)

db
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 10-07-2008, 11:05 AM
Member
 
Join Date: Oct 2008
Posts: 3
Rep Power: 0
joka22 is on a distinguished road
Default
thank you all!
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
iterator issues orchid New To Java 2 08-12-2008 01:43 PM
Issues with Jva I.O Annatar01 New To Java 0 02-08-2008 01:16 AM
Array issues Neo82 New To Java 1 12-31-2007 03:22 AM
Array traversal issues sondratheloser New To Java 1 12-11-2007 07:55 PM
jcheckbox issues need help. thanks. carlos123 New To Java 3 11-05-2007 10:37 PM


All times are GMT +2. The time now is 12:36 PM.



VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org