×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Truncating strings... how?

Truncating strings... how?

Truncating strings... how?

(OP)
Hey.

I just want to cut off the decimal.

Anybody know a site that just basically lists all the commands, or something?

I hate bugging you guys with simple syntax problems...

Thanks, as always...
      -Nexius

RE: Truncating strings... how?

you can use split to truncate strings.

@array = split("char_to_split_on", $var);

adam@aauser.com

RE: Truncating strings... how?

Pretty vauge question, but i'll give it a shot.  So, you have a string:  "935.356"  which is also a number, no?  If this is the case,
$number = int $number;
or even
$number = int 935.356;
 If it isn't a number, then you'll have to use regular expressions.  For lists of functions and for help with regular expressions, your perldocs will have that in it.  Read through them sometime.
(the actual perldoc library will be different depending on your system, otherwise i'd include instructions on that.)


"If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."

RE: Truncating strings... how?

NeXidus. Have a look at www.perl.com for some documentation although it should already be installed on your system. Try this command: 'perldoc perlmain'.


Mike
michael.j.lacey@ntlworld.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close