Loading ...
Sorry, an error occurred while loading the content.

[PBML] how to print a space

Expand Messages
  • Xiaoxiong Zhu
    1.How to print a string with spaces? print $a $b $c #Is it ok?One space before $b and two spaces before $c print $a $b $c #Which one is right? 2.How
    Message 1 of 2 , Sep 4, 1998
    • 0 Attachment
      1.How to print a string with spaces?
      print "$a $b $c" #Is it ok?One space before $b and two spaces before $c
      print "$a' '$b' '$c" #Which one is right?
      2.How to split a string with comma?
      $a=0,0,123
      @a=split(/,/,$a);
      @a=split(/","/,$a);# Which one is right?

      Thanks
      Xiaoxiong Zhu


      ____________________________________________________________________

      List Site: http://www.findmail.com/list/perl-beginner/
      To unsubscribe, send to perl-beginner-unsubscribe@...

      FREE group e-mail lists at http://www.findmail.com
    • Greg Webster
      ... I think this one should work fine. ... First, make $a= 0,0,123 ; (notice the quotes) then @a=split(/,/,$a); Greg A great many people think they are
      Message 2 of 2 , Sep 5, 1998
      • 0 Attachment
        At 09:37 AM 9/5/98 +0800, you wrote:
        >1.How to print a string with spaces?
        >print "$a $b $c" #Is it ok?One space before $b and two spaces before $c

        I think this one should work fine.

        >2.How to split a string with comma?
        >$a=0,0,123
        >@a=split(/,/,$a);
        >@a=split(/","/,$a);# Which one is right?

        First, make $a="0,0,123"; (notice the quotes)
        then @a=split(/,/,$a);

        Greg


        A great many people think they are thinking when they are merely
        rearranging their prejudices.
        -- William James gwebster@...

        ____________________________________________________________________

        List Site: http://www.findmail.com/list/perl-beginner/
        To unsubscribe, send to perl-beginner-unsubscribe@...

        FREE group e-mail lists at http://www.findmail.com
      Your message has been successfully submitted and would be delivered to recipients shortly.