Donald8274 Posted December 20, 2010 Share Posted December 20, 2010 Hello, Using StringInStr how do I have it have to find the complete word? For example: I want it to find "Tart" but not recognize "Tart" in the word "Start". Is there anything I can do that will make it find the whole word instead of just finding the word I want in a word? Link to comment Share on other sites More sharing options...
wakillon Posted December 20, 2010 Share Posted December 20, 2010 (edited) Hello, Using StringInStr how do I have it have to find the complete word? For example: I want it to find "Tart" but not recognize "Tart" in the word "Start". Is there anything I can do that will make it find the whole word instead of just finding the word I want in a word? $_String = 'Start' $_StringInStr = StringInStr ( $_String, 'Tart' ) ConsoleWrite ( "$_StringInStr : " & $_StringInStr & @Crlf ) It returns 2 Tart is well recognize in Start string ( by default it's not case sensitive ) Edited December 20, 2010 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
shanet Posted December 20, 2010 Share Posted December 20, 2010 Try _StringBetween function ! which can be used by including string.au3! [font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS: %programfiles%/AutoIt3/autoit3.chm Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 20, 2010 Moderators Share Posted December 20, 2010 Donald8274, A couple of possibilites for you: ; 1 2 3 4 5 ; 1 0 0 0 0 0 $sText = "Here are some words Start and a few more Tart and some to end" ; We should get 42 ; Use the casesense parameter to detect initial capital $iRet = StringInStr($sText, "Tart", 1) MsgBox(0, "Result", $iRet) ; Use leading space - do not forget to compensate for the extra character $iRet = StringInStr($sText, " tart") + 1 MsgBox(0, "Result", $iRet) No doubt there are many more but I hope one of those will suffice. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Donald8282 Posted December 21, 2010 Share Posted December 21, 2010 Wakillon, thank you. It works just how I need it to. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now