pause at 53minutes
This commit is contained in:
49
C# Full Course for free/Strings methods.md
Normal file
49
C# Full Course for free/Strings methods.md
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# String method
|
||||||
|
|
||||||
|
## ToUpper
|
||||||
|
|
||||||
|
set strings uppercase
|
||||||
|
|
||||||
|
```C#
|
||||||
|
String fullName = "mrsh";
|
||||||
|
fullName = fullName.ToUpper();
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tolower
|
||||||
|
|
||||||
|
set strings lowercase
|
||||||
|
|
||||||
|
```C#
|
||||||
|
String fullName = "mrsh";
|
||||||
|
fullName = fullName.ToLower();
|
||||||
|
```
|
||||||
|
|
||||||
|
## Replace
|
||||||
|
|
||||||
|
```C#
|
||||||
|
String phoneNumber = "123-456-789";
|
||||||
|
phoneNumber.Replace("-", "/");
|
||||||
|
```
|
||||||
|
|
||||||
|
## Insert
|
||||||
|
|
||||||
|
```C#
|
||||||
|
String fullName = "mrsh online";
|
||||||
|
userName = fullName.Insert(0, "@");
|
||||||
|
```
|
||||||
|
|
||||||
|
## Length
|
||||||
|
|
||||||
|
```C#
|
||||||
|
String fullName = "mrsh online";
|
||||||
|
fullName.Length();
|
||||||
|
```
|
||||||
|
|
||||||
|
## Substring
|
||||||
|
|
||||||
|
```C#
|
||||||
|
String fullName = "mrsh online";
|
||||||
|
String firstName = fullName.Substring(0,4);
|
||||||
|
String lastName = fullName.Substring(5,6);
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user