Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Name Space Provider

grekopgrekop Member Posts: 3
I want some perl code that can find the words of a sentenace one by one.

Thnx

Comments

  • XfactorXfactor Member Posts: 343
    : I want some perl code that can find the words of a sentenace one by one.
    :
    : Thnx
    :
    First off, you shouldn't ask for all of the code you are wanting. Not too many people will supply you with it. There may be some that don't mind but more do than not. The best way to get help is ask a question about a certain piece of code.

    Anyway about your question:
    Regular expressions will give you whatever you need in pattern matching.

    X
  • JonathanJonathan Member Posts: 2,914
    : I want some perl code that can find the words of a sentenace one by one.
    :
    : Thnx
    :

    Hi there,

    You can put the words into an array like this:-

    @words = split(/ /, $sentence);

    You may want need to strip the . off the end of the sentence first, which you could do maybe by using:-

    chop $sentence;

    Then do the above. Each element in the array will then be a word. I think that's what you're after.

    Good luck,

    Jonathan


    -------------------------------------------
    Count downloads from your site for free!
    http://www.downloadcounter.com/
    Oh yeah, I run a web hosting thing now too.
    http://www.incrahost.com/

  • bgibbybgibby Member Posts: 251
    : : I want some perl code that can find the words of a sentenace one by one.
    : :
    : : Thnx
    : :
    : First off, you shouldn't ask for all of the code you are wanting. Not too many people will supply you with it. There may be some that don't mind but more do than not. The best way to get help is ask a question about a certain piece of code.
    :
    : Anyway about your question:
    : Regular expressions will give you whatever you need in pattern matching.
    :
    : X
    :

    I agree...the first thing I didn't want to do when I read this was help!

    Cya
    Bradley
  • Justin BibJustin Bib USAMember Posts: 0

    ____ ( http://forcoder.org ) free ebooks and video tutorials about || Delphi, C++, C#, R, PHP, Ruby, PL/SQL, Assembly, Visual Basic .NET, Go, Swift, MATLAB, Java, Visual Basic, JavaScript, C, Perl, Python, Objective-C, Scratch Crystal, Ada, Julia, D, Prolog, Kotlin, Apex, Scheme, VBScript, Rust, Lua, Hack, Awk, LabVIEW, Clojure, Bash, Fortran, Logo, ML, Dart, F#, ABAP, FoxPro, Alice, Lisp, Transact-SQL, Erlang, Scala, SAS, COBOL || _____

Sign In or Register to comment.