Jump to content

StringSplit looking for a non array example please


meows
 Share

Go to solution Solved by water,

Recommended Posts

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.


Link to comment
Share on other sites

  • Solution

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)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

Glad to be of service :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...