Adds a CSharp Style String Object, and namespace emulating much of the syntax C# uses to manipulate strings.
Project description
csharpstring
A general class that provides dot-net style syntax for python string manipulations.
Static & Instance Namespaces
To more easily separate the objective, from non-objective functionality there are two classes internally that can be used.
csharpstring.instance
csharpstring.static
Instance Methods
value1 = instance("The quick brown fox");
print(value1)
The quick brown fox
value2 = instance("jumped over the lazy dog");
print(value2)
jumped over the lazy dog
value3 = value1.Append(value2);
print(value3)
The quick brown fox jumped over the lazy dog
value4 = value3.Substr(10,30);
brown fox jumped ove
value5 = value3.Replace("quick", "speedy");
print(value5)
The speedy brown fox jumped over the lazy dog
Static Methods
date = "10/31/22";
time = "8:30 PM";
print(static.Format("It is $0 on $1; do you know where your children are?", time, date));
print(static.Join(" ", value1, value2));
It is 8:30 PM on 10/31/22; do you know where your children are? The quick brown fox jumped over the lazy dog
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for csharpstring-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a1590ba05f5ee7cb8413928aa4dad38da550eafafefa8b3cb31546380d5b1f5 |
|
MD5 | 23c3a5e4221067375369fd7bda003a92 |
|
BLAKE2b-256 | e3a276c619c3ec40489518764ed43bdd6fff18dca682e342182dc6e8363c8ed5 |