Arclite86 Posted October 6, 2015 Share Posted October 6, 2015 (edited) hifor my administration im working with allot of codes and in every long code there is a # sing and al the letters and number need to be deleted befor that sing first i did it al manual but now if have hunderts of codes that i have to edit, i would like to know if someone can help me with thiscode example: example1: 49f039.201185f201k2#3152hr.3939532.500example2: 01jr12l492#29jg2.8h420v.mq024,24example3: 290k19525,.r20fc10931javw#2jf201jmv123t90gvjknetc...has the beexample1: 3152hr.3939532.500example2: 29jg2.8h420v.mq024,24example3: 2jf201jmv123t90gvjkncan someone help me with this please Edited October 6, 2015 by Arclite86 Link to comment Share on other sites More sharing options...
jguinch Posted October 6, 2015 Share Posted October 6, 2015 You can use StringTrimLeft + StringInStr. Look at the helpfile for more details about these two functions. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 6, 2015 Moderators Share Posted October 6, 2015 Arclite86,StringSplit should do the trick if there is only the single "#" character in the string.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...
mikell Posted October 6, 2015 Share Posted October 6, 2015 (edited) Or maybe ... a Str******xpReplace ? Edit$str = "49f039.201185f201k2#3152hr.3939532.500" ; an usual one ; $res = StringRegExpReplace($str, '^(.*?#)', "") ; a funny one $res = StringRegExpReplace($str, '\G.(?<!#.)', "") Msgbox(0,"", $res) Edited October 6, 2015 by mikell Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted October 6, 2015 Share Posted October 6, 2015 StringSplit() would be my first idea also. $sTest = "49f039.201185f201k2#3152hr.3939532.500" $aSplit = StringSplit($sTest, "#") MsgBox(0, "", $aSplit[$aSplit[0]]) Link to comment Share on other sites More sharing options...
jguinch Posted October 6, 2015 Share Posted October 6, 2015 @mikell : you rarely use the count parameter with StringRegExp $res = StringRegExpReplace($str, '[^#]+#', "", 1) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
mikell Posted October 6, 2015 Share Posted October 6, 2015 jguinch,Here with either the ^ or the \G anchors it was useless 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