meows Posted February 12, 2015 Posted February 12, 2015 12 where is a simple StringSplit at delimeter example please? Copy to clipboard #include <MsgBoxConstants.au3> Example() Func Example() Local $aDays = StringSplit("Mon,Tues,Wed,Thur,Fri,Sat,Sun", ",") ; Split the string of days using the delimeter "," and the default flag value. #cs The array returned will contain the following values: $aDays[1] = "Mon" $aDays[2] = "Tues" $aDays[3] = "Wed" ... $aDays[7] = "Sun" #ce For $i = 1 To $aDays[0] ; Loop through the array returned by StringSplit to display the individual values. MsgBox($MB_SYSTEMMODAL, "", "$aDays[" & $i & "] - " & $aDays[$i]) Next EndFunc ;==>Example I went through Datatypes Operators Conditional Obj Statements I had high hopes for Obj statements but it was a waste so I went to Google, Yahoo, Yandex, Sohu, and Baidu. All I learned is that Baidu has more mobile customers than the US has people! I need to separate this string at each to enter into a database BabyMAKERrootCIMV2:Win32_Service.Name="Apache2.4"BabyMAKERrootCIMV2:Win32_Service.Name="Apache2.4"BabyMAKERrootCIMV2:Win32_Service.Name="AppIDSvc"BabyMAKERrootCIMV2:Win32_Service.Name="AppIDSvc"BabyMAKERrootCIMV2:Win32_Service.Name="AppIDSvc"BabyMAKERrootCIMV2:Win32_Service.Name="Appinfo"BabyMAKERrootCIMV2:Win32_Service.Name="Appinfo"BabyMAKERrootCIMV2:Win32_Service.Name="asComSvc" ALL three examples are ARRAYS.... If I wanted a tree I go to the beach and catch a fish and plant it deep with lots of tree food. Then water it daily waiting for the day the fish turns into a tree. Is it a joke? I did a search array in the help(Help control 6.1) file for array and got NO RESULTS. I tried the trim examples and they worked great but I have no way of knowing how long each string will be at the delimeter so where is a simple StringSplit at delimeter example please? I know I had to miss it.
Solution water Posted February 12, 2015 Solution Posted February 12, 2015 I'm not sure I fully understand your needs. But maybe this works: #include <array.au3> #include <StringConstants.au3> Global $sString = '\\BabyMAKER\root\CIMV2:Win32_Service.Name="Apache2.4"\\BabyMAKER\root\CIMV2:Win32_Service.Name="Apache2.4"\\BabyMAKER\root\CIMV2:Win32_Service.Name="AppIDSvc"\\BabyMAKER' $aResult = StringSplit($sString, "\\", $STR_ENTIRESPLIT) _ArrayDisplay($aResult) meows 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
meows Posted February 12, 2015 Author Posted February 12, 2015 Many thanks it is workable! Bless you and my husband says thanks, and maybe I can find my way to the kitchen and cook for him, *hugs* 90
water Posted February 12, 2015 Posted February 12, 2015 Glad to be of service My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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