Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,939 questions

51,876 answers

573 users

How to get all methods of String Class in C#

1 Answer

0 votes
using System;
using System.Linq;
      
class Program
{
    static void ShowMethods(Type type) {
        foreach (var method in type.GetMethods()) {
            var parameterDescriptions = string.Join
                             (", ", method.GetParameters()
                             .Select(x => x.ParameterType + " " + x.Name)
                             .ToArray());
      
            Console.WriteLine("{0} {1}({2})",
                              method.ReturnType,
                              method.Name,
                              parameterDescriptions);
        }
    }
      
    static void Main() {
        ShowMethods(typeof(String));
    }
}
      
    
      
      
/*
run:
 
System.Int32 Compare(System.String strA, System.String strB)
System.Int32 Compare(System.String strA, System.String strB, System.Boolean ignoreCase)
System.Int32 Compare(System.String strA, System.String strB, System.StringComparison comparisonType)
System.Int32 Compare(System.String strA, System.String strB, System.Globalization.CultureInfo culture, System.Globalization.CompareOptions options)
System.Int32 Compare(System.String strA, System.String strB, System.Boolean ignoreCase, System.Globalization.CultureInfo culture)
System.Int32 Compare(System.String strA, System.Int32 indexA, System.String strB, System.Int32 indexB, System.Int32 length)
System.Int32 Compare(System.String strA, System.Int32 indexA, System.String strB, System.Int32 indexB, System.Int32 length, System.Boolean ignoreCase)
System.Int32 Compare(System.String strA, System.Int32 indexA, System.String strB, System.Int32 indexB, System.Int32 length, System.Boolean ignoreCase, System.Globalization.CultureInfo culture)
System.Int32 Compare(System.String strA, System.Int32 indexA, System.String strB, System.Int32 indexB, System.Int32 length, System.Globalization.CultureInfo culture, System.Globalization.CompareOptions options)
System.Int32 Compare(System.String strA, System.Int32 indexA, System.String strB, System.Int32 indexB, System.Int32 length, System.StringComparison comparisonType)
System.Int32 CompareOrdinal(System.String strA, System.String strB)
System.Int32 CompareOrdinal(System.String strA, System.Int32 indexA, System.String strB, System.Int32 indexB, System.Int32 length)
System.Int32 CompareTo(System.Object value)
System.Int32 CompareTo(System.String strB)
System.Boolean EndsWith(System.String value)
System.Boolean EndsWith(System.String value, System.StringComparison comparisonType)
System.Boolean EndsWith(System.String value, System.Boolean ignoreCase, System.Globalization.CultureInfo culture)
System.Boolean EndsWith(System.Char value)
System.Boolean Equals(System.Object obj)
System.Boolean Equals(System.String value)
System.Boolean Equals(System.String value, System.StringComparison comparisonType)
System.Boolean Equals(System.String a, System.String b)
System.Boolean Equals(System.String a, System.String b, System.StringComparison comparisonType)
System.Boolean op_Equality(System.String a, System.String b)
System.Boolean op_Inequality(System.String a, System.String b)
System.Int32 GetHashCode()
System.Int32 GetHashCode(System.StringComparison comparisonType)
System.Boolean StartsWith(System.String value)
System.Boolean StartsWith(System.String value, System.StringComparison comparisonType)
System.Boolean StartsWith(System.String value, System.Boolean ignoreCase, System.Globalization.CultureInfo culture)
System.Boolean StartsWith(System.Char value)
System.String Concat(System.Object arg0)
System.String Concat(System.Object arg0, System.Object arg1)
System.String Concat(System.Object arg0, System.Object arg1, System.Object arg2)
System.String Concat(System.Object[] args)
System.String Concat(System.Collections.Generic.IEnumerable`1[T] values)
System.String Concat(System.Collections.Generic.IEnumerable`1[System.String] values)
System.String Concat(System.String str0, System.String str1)
System.String Concat(System.String str0, System.String str1, System.String str2)
System.String Concat(System.String str0, System.String str1, System.String str2, System.String str3)
System.String Concat(System.String[] values)
System.String Format(System.String format, System.Object arg0)
System.String Format(System.String format, System.Object arg0, System.Object arg1)
System.String Format(System.String format, System.Object arg0, System.Object arg1, System.Object arg2)
System.String Format(System.String format, System.Object[] args)
System.String Format(System.IFormatProvider provider, System.String format, System.Object arg0)
System.String Format(System.IFormatProvider provider, System.String format, System.Object arg0, System.Object arg1)
System.String Format(System.IFormatProvider provider, System.String format, System.Object arg0, System.Object arg1, System.Object arg2)
System.String Format(System.IFormatProvider provider, System.String format, System.Object[] args)
System.String Insert(System.Int32 startIndex, System.String value)
System.String Join(System.Char separator, System.String[] value)
System.String Join(System.Char separator, System.Object[] values)
System.String Join(System.Char separator, System.Collections.Generic.IEnumerable`1[T] values)
System.String Join(System.Char separator, System.String[] value, System.Int32 startIndex, System.Int32 count)
System.String Join(System.String separator, System.String[] value)
System.String Join(System.String separator, System.Object[] values)
System.String Join(System.String separator, System.Collections.Generic.IEnumerable`1[T] values)
System.String Join(System.String separator, System.Collections.Generic.IEnumerable`1[System.String] values)
System.String Join(System.String separator, System.String[] value, System.Int32 startIndex, System.Int32 count)
System.String PadLeft(System.Int32 totalWidth)
System.String PadLeft(System.Int32 totalWidth, System.Char paddingChar)
System.String PadRight(System.Int32 totalWidth)
System.String PadRight(System.Int32 totalWidth, System.Char paddingChar)
System.String Remove(System.Int32 startIndex, System.Int32 count)
System.String Remove(System.Int32 startIndex)
System.String Replace(System.String oldValue, System.String newValue, System.Boolean ignoreCase, System.Globalization.CultureInfo culture)
System.String Replace(System.String oldValue, System.String newValue, System.StringComparison comparisonType)
System.String Replace(System.Char oldChar, System.Char newChar)
System.String Replace(System.String oldValue, System.String newValue)
System.String[] Split(System.Char separator, System.StringSplitOptions options)
System.String[] Split(System.Char separator, System.Int32 count, System.StringSplitOptions options)
System.String[] Split(System.Char[] separator)
System.String[] Split(System.Char[] separator, System.Int32 count)
System.String[] Split(System.Char[] separator, System.StringSplitOptions options)
System.String[] Split(System.Char[] separator, System.Int32 count, System.StringSplitOptions options)
System.String[] Split(System.String separator, System.StringSplitOptions options)
System.String[] Split(System.String separator, System.Int32 count, System.StringSplitOptions options)
System.String[] Split(System.String[] separator, System.StringSplitOptions options)
System.String[] Split(System.String[] separator, System.Int32 count, System.StringSplitOptions options)
System.String Substring(System.Int32 startIndex)
System.String Substring(System.Int32 startIndex, System.Int32 length)
System.String ToLower()
System.String ToLower(System.Globalization.CultureInfo culture)
System.String ToLowerInvariant()
System.String ToUpper()
System.String ToUpper(System.Globalization.CultureInfo culture)
System.String ToUpperInvariant()
System.String Trim()
System.String Trim(System.Char trimChar)
System.String Trim(System.Char[] trimChars)
System.String TrimStart()
...
 
*/

 



answered Sep 26, 2023 by avibootz

Related questions

1 answer 97 views
1 answer 136 views
136 views asked Oct 14, 2023 by avibootz
1 answer 108 views
108 views asked Oct 13, 2023 by avibootz
1 answer 89 views
1 answer 92 views
1 answer 109 views
109 views asked Sep 21, 2023 by avibootz
1 answer 105 views
...