SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3

Thread: Stripping text

  1. #1
    Junior Member
    Join Date
    Aug 2002
    Location
    Aurora, CO, USA
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Stripping text

    Hello everyone -

    Using menu_get_item, I'm capturing the value of each item in a menu to compare the text with the associated toolbar button's tooltip. However, each menu item has a shortcut key on the end of it. For example, menu_get_item("File",0,value); returns the value of "New Ctrl+N". I would like to strip the Ctrl+N off the end. Most of the menu items are setup this way, except for a couple.

    Is it possible to strip off the end?

    Thanks in advance -
    kr8ivemind

    ------------------

  2. #2
    Senior Member
    Join Date
    May 2001
    Location
    Ankh-Morpork
    Posts
    2,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Stripping text

    Through use of substr() and either index() or match() you should be able to do this. You can get the position in the string at which "Ctrl" appears via index() or match(). If the returned value is greater than 0, then you know you want to use substr() to extract just the first part of the string, something like

    ------------------
    Charles Reace

    #!/usr/bin/perl
    my @email = qw(charles reace verizon net);
    printf("%s.%s@%s.%s\n", $email[0], $email[1], $email[2], $email[3]);
    web site | [url=http://www.ebookworm.us/[/url]

    [i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.</i] (The Song of Roland)

  3. #3
    Junior Member
    Join Date
    Aug 2002
    Location
    Aurora, CO, USA
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Stripping text

    Thanks - I'll give it a try.

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 06:56 PM.

Copyright BetaSoft Inc.