Connection.stringSplit

Extract the provider, connection parameters, username and password from string. in string, the various parts are strings which are expected to be encoded using an RFC 1738 compliant encoding. If they are specified, the returned provider, username and password strings are correctly decoded.

For example all the following connection strings: <programlisting><![CDATA[ PostgreSQL://meme:passDB_NAME=mydb;HOST=server PostgreSQL://memeDB_NAME=mydb;HOST=server;PASSWORD=pass PostgreSQL://memeDB_NAME=mydb;PASSWORD=pass;HOST=server PostgreSQL://memePASSWORD=pass;DB_NAME=mydb;HOST=server PostgreSQL://DB_NAME=mydb;HOST=server;USERNAME=meme;PASSWORD=pass PostgreSQL://DB_NAME=mydb;HOST=server;PASSWORD=pass;USERNAME=meme PostgreSQL://DB_NAME=mydb;USERNAME=meme;PASSWORD=pass;HOST=server PostgreSQL://PASSWORD=pass;USERNAME=meme;DB_NAME=mydb;HOST=server PostgreSQL://:passUSERNAME=meme;DB_NAME=mydb;HOST=server PostgreSQL://:passDB_NAME=mydb;HOST=server;USERNAME=meme]]></programlisting>

will return the following new strings (double quotes added here to delimit strings): <programlisting><![CDATA[

class Connection
static
void
stringSplit
(
string string_
,
out string outCncParams
,
out string outProvider
,
out string outUsername
,
out string outPassword
)

Parameters

string_ string

a string in the "[&lt;provider&gt;://][&lt;username&gt;[:&lt;password&gt;]@]&lt;connection_params&gt;" form

outCncParams string

a place to store the new string containing the &lt;connection_params&gt; part

outProvider string

a place to store the new string containing the &lt;provider&gt; part

outUsername string

a place to store the new string containing the &lt;username&gt; part

outPassword string

a place to store the new string containing the &lt;password&gt; part, or null

Detailed Description

out cnc params

"DB_NAME=mydb;HOST=server"

out provider

"PostgreSQL"

out username

"meme"

out password

"pass"]]></programlisting>