LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-08-2004, 10:27 AM   #1
k1ll3r_x
Member
 
Registered: Sep 2004
Location: Laredo, TX
Distribution: Debian 11
Posts: 164

Rep: Reputation: 30
Something Weird [ Java]


Code:
import java.io.*;
public class class1{
public static void main
(String args [])
{
String s = "UIL STATE 2004";
String [] t = s.split("[AEIOU]");
System.out.println(t[2]);
System.out.println(t.length);
}
}
im getting pretty confussed about this, when i put a lil space in the
Quote:
String [] t = s.split("[AEIOU]");
and make it look like this
Quote:
String [] t = s.split;(" [AEIOU] ")
then i get a total different answer, and im wondering why, im suppossed to get L*ST (if space where to be considered the *)
and for the second one i should be getting a five which i am, but, only if the space inside the quotations is removed, would someone plz help me, by explaning me a little bit more about this, thank you.

Last edited by k1ll3r_x; 12-08-2004 at 11:05 AM.
 
Old 12-08-2004, 10:52 AM   #2
k1ll3r_x
Member
 
Registered: Sep 2004
Location: Laredo, TX
Distribution: Debian 11
Posts: 164

Original Poster
Rep: Reputation: 30
ok ive been observing this program a little closer, and what its doing, its that it counts the first 2 spaces, and the ones after do not appear, nor count, and id like to ask why its doing that, plz again if someone could help, id really appreciate
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
weird, weird problems with logitech precision USB gamepad ikataii Linux - Hardware 4 10-14-2005 04:31 AM
Weird Wish :D ekinox Linux - Networking 1 04-12-2005 12:30 PM
HP Photosmart weird weird weird.... Vlad_M Linux - General 5 02-20-2005 05:41 AM
Weird, weird apache2 problem atheist Debian 1 09-17-2004 08:26 PM
Weird Bigun Linux - Software 2 09-22-2002 02:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration