SlideShare a Scribd company logo
C# Tutorial
Part 14:
String
www.siri-kt.blogspot.com
• In C#, string is an object of System.String class
that represent sequence of characters. We can
perform many operations on strings such as
concatenation, comparision, getting substring,
search, trim, replacement etc.
• string vs String
• In C#, string is keyword which is an alias
for System.String class. That is why string and
String are equivalent. We are free to use any
naming convention.
• string s1 = "hello";//creating string using string key
Method Name Description
Clone() It is used to return a reference to this instance of String.
Compare(String,
String)
It is used to compares two specified String objects. It returns an integer
that indicates their relative position in the sort order.
CompareOrdinal(Strin
g, String)
It is used to compare two specified String objects by evaluating the
numeric values of the corresponding Char objects in each string..
CompareTo(String) It is used to compare this instance with a specified String object. It
indicates whether this instance precedes, follows, or appears in the same
position in the sort order as the specified string.
Concat(String, String) It is used to concatenate two specified instances of String.
Contains(String) It is used to return a value indicating whether a specified substring occurs
within this string.
Copy(String) It is used to create a new instance of String with the same value as a
specified String.
CopyTo(Int32,
Char[], Int32,
Int32)
It is used to copy a specified number of characters from a specified position
in this instance to a specified position in an array of Unicode characters.
EndsWith(String) It is used to check that the end of this string instance matches the specified
string.
Equals(String,
String)
It is used to determine that two specified String objects have the same
value.
Format(String,
Object)
It is used to replace one or more format items in a specified string with the
string representation of a specified object.
GetEnumerator() It is used to retrieve an object that can iterate through the individual
characters in this string.
GetHashCode() It returns the hash code for this string.
GetType() It is used to get the Type of the current instance.
GetTypeCode() It is used to return the TypeCode for class String.
IndexOf(String) It is used to report the zero-based index of the first occurrence of the
specified string in this instance.
Insert(Int32,
String)
It is used to return a new string in which a specified string is inserted at a
specified index position.
Intern(String) It is used to retrieve the system's reference to the specified String.
IsInterned(Strin
g)
It is used to retrieve a reference to a specified String.
IsNormalized() It is used to indicate that this string is in Unicode normalization form C.
IsNullOrEmpty(S
tring)
It is used to indicate that the specified string is null or an Empty string.
IsNullOrWhiteS
pace(String)
It is used to indicate whether a specified string is null, empty, or consists only of
white-space characters.
Join(String,
String[])
It is used to concatenate all the elements of a string array, using the specified
separator between each element.
LastIndexOf(Cha
r)
It is used to report the zero-based index position of the last occurrence of a
specified character within String.
LastIndexOfAny(
Char[])
It is used to report the zero-based index position of the last occurrence in this
instance of one or more characters specified in a Unicode array.
Normalize() It is used to return a new string whose textual value is the same as this string,
but whose binary representation is in Unicode normalization form C.
PadLeft(Int32) It is used to return a new string that right-aligns the characters in this instance
by padding them with spaces on the left.
PadRight(Int32) It is used to return a new string that left-aligns the characters in this string by
padding them with spaces on the right.
Remove(Int32) It is used to return a new string in which all the characters in the current
instance, beginning at a specified position and continuing through the last
Split(Char[]) It is used to split a string into substrings that are based on the characters in an
array.
StartsWith(
String)
It is used to check whether the beginning of this string instance matches the
specified string.
Substring(In
t32)
It is used to retrieve a substring from this instance. The substring starts at a
specified character position and continues to the end of the string.
ToCharArray
()
It is used to copy the characters in this instance to a Unicode character array.
ToLower() It is used to convert String into lowercase.
ToLowerInva
riant()
It is used to return convert String into lowercase using the casing rules of the
invariant culture.
ToString() It is used to return instance of String.
ToUpper() It is used to convert String into uppercase.
Trim() It is used to remove all leading and trailing white-space characters from the current
String object.
TrimEnd(Cha
r[])
It Is used to remove all trailing occurrences of a set of characters specified in an
array from the current String object.
TrimStart(C
har[])
It is used to remove all leading occurrences of a set of characters specified in an
array from the current String object.Next TopicC# String Clone()← prevnext →
SIRIKT
Sharing Knowledge is Learning
For more visit our website
www.siri-kt.blogspot.com

More Related Content

What's hot

Arrays in programming
Arrays in programmingArrays in programming
Arrays in programming
TaseerRao
 
Data types in python lecture (2)
Data types in python lecture (2)Data types in python lecture (2)
Data types in python lecture (2)
Ali ٍSattar
 
Values and Data types in python
Values and Data types in pythonValues and Data types in python
Values and Data types in python
Jothi Thilaga P
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
Mohammed Khan
 
Regex posix
Regex posixRegex posix
Regex posix
sana mateen
 
Chapter3 basic java data types and declarations
Chapter3 basic java data types and declarationsChapter3 basic java data types and declarations
Chapter3 basic java data types and declarationssshhzap
 
Strings
StringsStrings
Strings
Saranya saran
 
arrays and pointers
arrays and pointersarrays and pointers
arrays and pointers
Samiksha Pun
 
Introduction To Programming with Python-4
Introduction To Programming with Python-4Introduction To Programming with Python-4
Introduction To Programming with Python-4
Syed Farjad Zia Zaidi
 
Python Data-Types
Python Data-TypesPython Data-Types
Python Data-Types
Akhil Kaushik
 
Acm aleppo cpc training sixth session
Acm aleppo cpc training sixth sessionAcm aleppo cpc training sixth session
Acm aleppo cpc training sixth session
Ahmad Bashar Eter
 
Strings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothiStrings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothi
Sowmya Jyothi
 
Anton Kasyanov, Introduction to Python, Lecture3
Anton Kasyanov, Introduction to Python, Lecture3Anton Kasyanov, Introduction to Python, Lecture3
Anton Kasyanov, Introduction to Python, Lecture3Anton Kasyanov
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
Kashif Nawab
 
Python Collections
Python CollectionsPython Collections
Python Collections
sachingarg0
 
Data Structure In C#
Data Structure In C#Data Structure In C#
Data Structure In C#
Shahzad
 

What's hot (19)

Arrays in programming
Arrays in programmingArrays in programming
Arrays in programming
 
Data types in python lecture (2)
Data types in python lecture (2)Data types in python lecture (2)
Data types in python lecture (2)
 
Values and Data types in python
Values and Data types in pythonValues and Data types in python
Values and Data types in python
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
M C6java7
M C6java7M C6java7
M C6java7
 
Regex posix
Regex posixRegex posix
Regex posix
 
Chapter3 basic java data types and declarations
Chapter3 basic java data types and declarationsChapter3 basic java data types and declarations
Chapter3 basic java data types and declarations
 
Strings
StringsStrings
Strings
 
arrays and pointers
arrays and pointersarrays and pointers
arrays and pointers
 
Introduction To Programming with Python-4
Introduction To Programming with Python-4Introduction To Programming with Python-4
Introduction To Programming with Python-4
 
Python Data-Types
Python Data-TypesPython Data-Types
Python Data-Types
 
Acm aleppo cpc training sixth session
Acm aleppo cpc training sixth sessionAcm aleppo cpc training sixth session
Acm aleppo cpc training sixth session
 
Strings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothiStrings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothi
 
Tuple
TupleTuple
Tuple
 
Anton Kasyanov, Introduction to Python, Lecture3
Anton Kasyanov, Introduction to Python, Lecture3Anton Kasyanov, Introduction to Python, Lecture3
Anton Kasyanov, Introduction to Python, Lecture3
 
M C6java2
M C6java2M C6java2
M C6java2
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
 
Python Collections
Python CollectionsPython Collections
Python Collections
 
Data Structure In C#
Data Structure In C#Data Structure In C#
Data Structure In C#
 

Similar to 13string in c#

String and string buffer
String and string bufferString and string buffer
String and string bufferkamal kotecha
 
stringstringbuilderstringbuffer-190830060142.pptx
stringstringbuilderstringbuffer-190830060142.pptxstringstringbuilderstringbuffer-190830060142.pptx
stringstringbuilderstringbuffer-190830060142.pptx
ssuser99ca78
 
Computer programming 2 Lesson 12
Computer programming 2  Lesson 12Computer programming 2  Lesson 12
Computer programming 2 Lesson 12
MLG College of Learning, Inc
 
Strings.ppt
Strings.pptStrings.ppt
Strings.ppt
SanthiyaAK
 
Python strings
Python stringsPython strings
Python strings
Mohammed Sikander
 
Module-1 Strings Handling.ppt.pdf
Module-1 Strings Handling.ppt.pdfModule-1 Strings Handling.ppt.pdf
Module-1 Strings Handling.ppt.pdf
learnEnglish51
 
Module 6 - String Manipulation.pdf
Module 6 - String Manipulation.pdfModule 6 - String Manipulation.pdf
Module 6 - String Manipulation.pdf
MegMeg17
 
Java
JavaJava
Lecture 7
Lecture 7Lecture 7
Java: Regular Expression
Java: Regular ExpressionJava: Regular Expression
Java: Regular ExpressionMasudul Haque
 
Java String Handling
Java String HandlingJava String Handling
Java String Handling
Infoviaan Technologies
 
Chapter 9 - Characters and Strings
Chapter 9 - Characters and StringsChapter 9 - Characters and Strings
Chapter 9 - Characters and Strings
Eduardo Bergavera
 
Python data handling
Python data handlingPython data handling
Python data handling
Prof. Dr. K. Adisesha
 
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdfSTRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
Java căn bản - Chapter9
Java căn bản - Chapter9Java căn bản - Chapter9
Java căn bản - Chapter9Vince Vo
 
Strings part2
Strings part2Strings part2
Strings part2
yndaravind
 
easyPy-Basic.pdf
easyPy-Basic.pdfeasyPy-Basic.pdf
easyPy-Basic.pdf
Mina Firoozgohar
 

Similar to 13string in c# (20)

Strings
StringsStrings
Strings
 
String, string builder, string buffer
String, string builder, string bufferString, string builder, string buffer
String, string builder, string buffer
 
String and string buffer
String and string bufferString and string buffer
String and string buffer
 
stringstringbuilderstringbuffer-190830060142.pptx
stringstringbuilderstringbuffer-190830060142.pptxstringstringbuilderstringbuffer-190830060142.pptx
stringstringbuilderstringbuffer-190830060142.pptx
 
Computer programming 2 Lesson 12
Computer programming 2  Lesson 12Computer programming 2  Lesson 12
Computer programming 2 Lesson 12
 
Strings.ppt
Strings.pptStrings.ppt
Strings.ppt
 
Python strings
Python stringsPython strings
Python strings
 
Module-1 Strings Handling.ppt.pdf
Module-1 Strings Handling.ppt.pdfModule-1 Strings Handling.ppt.pdf
Module-1 Strings Handling.ppt.pdf
 
Module 6 - String Manipulation.pdf
Module 6 - String Manipulation.pdfModule 6 - String Manipulation.pdf
Module 6 - String Manipulation.pdf
 
Java
JavaJava
Java
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Java: Regular Expression
Java: Regular ExpressionJava: Regular Expression
Java: Regular Expression
 
Java String Handling
Java String HandlingJava String Handling
Java String Handling
 
Chapter 9 - Characters and Strings
Chapter 9 - Characters and StringsChapter 9 - Characters and Strings
Chapter 9 - Characters and Strings
 
Python data handling
Python data handlingPython data handling
Python data handling
 
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdfSTRINGS IN C MRS.SOWMYA JYOTHI.pdf
STRINGS IN C MRS.SOWMYA JYOTHI.pdf
 
Java căn bản - Chapter9
Java căn bản - Chapter9Java căn bản - Chapter9
Java căn bản - Chapter9
 
Strings part2
Strings part2Strings part2
Strings part2
 
07slide
07slide07slide
07slide
 
easyPy-Basic.pdf
easyPy-Basic.pdfeasyPy-Basic.pdf
easyPy-Basic.pdf
 

More from Sireesh K

Cn10
Cn10Cn10
Cn10
Sireesh K
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
Sireesh K
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
Sireesh K
 
What is mvc
What is mvcWhat is mvc
What is mvc
Sireesh K
 
31c
31c31c
31cs
31cs31cs
31cs
Sireesh K
 
45c
45c45c
44c
44c44c
43c
43c43c
42c
42c42c
41c
41c41c
40c
40c40c
39c
39c39c
38c
38c38c
37c
37c37c
35c
35c35c
34c
34c34c
33c
33c33c
30c
30c30c
29c
29c29c

More from Sireesh K (20)

Cn10
Cn10Cn10
Cn10
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
chanakya neeti
chanakya neetichanakya neeti
chanakya neeti
 
What is mvc
What is mvcWhat is mvc
What is mvc
 
31c
31c31c
31c
 
31cs
31cs31cs
31cs
 
45c
45c45c
45c
 
44c
44c44c
44c
 
43c
43c43c
43c
 
42c
42c42c
42c
 
41c
41c41c
41c
 
40c
40c40c
40c
 
39c
39c39c
39c
 
38c
38c38c
38c
 
37c
37c37c
37c
 
35c
35c35c
35c
 
34c
34c34c
34c
 
33c
33c33c
33c
 
30c
30c30c
30c
 
29c
29c29c
29c
 

Recently uploaded

1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 

Recently uploaded (20)

1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 

13string in c#

  • 2. • In C#, string is an object of System.String class that represent sequence of characters. We can perform many operations on strings such as concatenation, comparision, getting substring, search, trim, replacement etc. • string vs String • In C#, string is keyword which is an alias for System.String class. That is why string and String are equivalent. We are free to use any naming convention. • string s1 = "hello";//creating string using string key
  • 3. Method Name Description Clone() It is used to return a reference to this instance of String. Compare(String, String) It is used to compares two specified String objects. It returns an integer that indicates their relative position in the sort order. CompareOrdinal(Strin g, String) It is used to compare two specified String objects by evaluating the numeric values of the corresponding Char objects in each string.. CompareTo(String) It is used to compare this instance with a specified String object. It indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified string. Concat(String, String) It is used to concatenate two specified instances of String. Contains(String) It is used to return a value indicating whether a specified substring occurs within this string. Copy(String) It is used to create a new instance of String with the same value as a specified String.
  • 4. CopyTo(Int32, Char[], Int32, Int32) It is used to copy a specified number of characters from a specified position in this instance to a specified position in an array of Unicode characters. EndsWith(String) It is used to check that the end of this string instance matches the specified string. Equals(String, String) It is used to determine that two specified String objects have the same value. Format(String, Object) It is used to replace one or more format items in a specified string with the string representation of a specified object. GetEnumerator() It is used to retrieve an object that can iterate through the individual characters in this string. GetHashCode() It returns the hash code for this string. GetType() It is used to get the Type of the current instance. GetTypeCode() It is used to return the TypeCode for class String. IndexOf(String) It is used to report the zero-based index of the first occurrence of the specified string in this instance. Insert(Int32, String) It is used to return a new string in which a specified string is inserted at a specified index position.
  • 5. Intern(String) It is used to retrieve the system's reference to the specified String. IsInterned(Strin g) It is used to retrieve a reference to a specified String. IsNormalized() It is used to indicate that this string is in Unicode normalization form C. IsNullOrEmpty(S tring) It is used to indicate that the specified string is null or an Empty string. IsNullOrWhiteS pace(String) It is used to indicate whether a specified string is null, empty, or consists only of white-space characters. Join(String, String[]) It is used to concatenate all the elements of a string array, using the specified separator between each element. LastIndexOf(Cha r) It is used to report the zero-based index position of the last occurrence of a specified character within String. LastIndexOfAny( Char[]) It is used to report the zero-based index position of the last occurrence in this instance of one or more characters specified in a Unicode array. Normalize() It is used to return a new string whose textual value is the same as this string, but whose binary representation is in Unicode normalization form C. PadLeft(Int32) It is used to return a new string that right-aligns the characters in this instance by padding them with spaces on the left. PadRight(Int32) It is used to return a new string that left-aligns the characters in this string by padding them with spaces on the right. Remove(Int32) It is used to return a new string in which all the characters in the current instance, beginning at a specified position and continuing through the last
  • 6. Split(Char[]) It is used to split a string into substrings that are based on the characters in an array. StartsWith( String) It is used to check whether the beginning of this string instance matches the specified string. Substring(In t32) It is used to retrieve a substring from this instance. The substring starts at a specified character position and continues to the end of the string. ToCharArray () It is used to copy the characters in this instance to a Unicode character array. ToLower() It is used to convert String into lowercase. ToLowerInva riant() It is used to return convert String into lowercase using the casing rules of the invariant culture. ToString() It is used to return instance of String. ToUpper() It is used to convert String into uppercase. Trim() It is used to remove all leading and trailing white-space characters from the current String object. TrimEnd(Cha r[]) It Is used to remove all trailing occurrences of a set of characters specified in an array from the current String object. TrimStart(C har[]) It is used to remove all leading occurrences of a set of characters specified in an array from the current String object.Next TopicC# String Clone()← prevnext →
  • 8. For more visit our website www.siri-kt.blogspot.com