Solved

Demilter without string tokenizer

Posted on 2006-11-01
4
254 Views
Last Modified: 2010-03-05
Hi

I am looking for sample code that will file spaces and get the words in the sentance.
Problem is I cannot use string tokenizer.

example: " THIS IS THE STRING"
$word1 = THIS
$word2 = IS
$word3 = THE
...

It is very urgent. It would be great if you can get me sample code...

Thanks
0
Comment
Question by:basirana
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 8

Accepted Solution

by:
Perl_Diver earned 500 total points
ID: 17851408
This might be too blunt but your example string shows only words seperated by spaces

my $string = 'THIS IS THE STRING';
my @words = $string =~ /(\S+)/g;
print "$_\n" for @words;
0
 
LVL 8

Expert Comment

by:Perl_Diver
ID: 17851416
Please explain what's the urgency? Are you sitting in class taking a test?
0
 
LVL 84

Expert Comment

by:ozo
ID: 17851618

($word1,$word2,$word3)=split for " THIS IS THE STRING"
0
 
LVL 8

Expert Comment

by:Perl_Diver
ID: 17859244
I guess it was really urgent......
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question