Connection.parseConnectionString

Parses a connection string of the form "host=localhost;port=3306;user=joe;pwd=pass123;db=myappsdb"

Port is optional and defaults to 3306.

Whitespace surrounding any name or value is automatically stripped.

Returns a five-element array of strings in this order:

  • [0]: host
  • [1]: user
  • [2]: pwd
  • [3]: db
  • [4]: port

(TODO: The connection string needs work to allow for semicolons in its parts!)

class Connection
static
string[]
parseConnectionString
(
string cs
)

Meta