×

C# Tutorial

Basics of .Net

C# Basics

C# Fundamentals

C# Operators

C# Loops

C# Type Conversions

C# Exception Handling

C# String Class

C# Arrays

C# List

C# Stack

C# Queue

C# Collections

C# Character Class

C# Class and Object

C# Namespaces

C# Delegates

C# Constructors

C# Inheritance

C# Operator Overloading

C# Structures

C# File Handling

C# Convert.ToInt32()

C# Int32 (int) Struct

C# DateTime Class

C# Uri Class

C# Database Connectivity

C# Windows

C# Other Topics

C# Q & A

C# Programs

C# Find O/P

Home » C#

C# | Uri.IsHexEncoding() Method with Example

Uri.IsHexEncoding() Method: Here, we are going to learn about the IsHexEncoding() method of Uri class with example in C#.
Submitted by Nidhi, on March 26, 2020

Uri.IsHexEncoding() Method

Uri.IsHexEncoding() method is a static method or Uri class. Which is used to return that given string is hex-encoded or not? If the given string is hex coded then it returns true otherwise it returns false.

Syntax:

    bool Uri.IsHexEncoding(string str, int index);

Parameter(s):

  • string str – represents the string to be checked for hex encoding.
  • int index – represents the index for given string.

Return value:

The return type of this method is boolean, it returns true if given string is hex-encoded otherwise returns false.

Example to demonstrate example of Uri.IsHexEncoding() method

using System;

class UriExample
{
    //Entry point of Program
    static public void Main()
    {
        string str1 = "%75";
        string str2 = "75";

        if (Uri.IsHexEncoding(str1, 0))
            Console.WriteLine("Given string is hex-encoded");
        else
            Console.WriteLine("Given string is not hex-encoded");

        if (Uri.IsHexEncoding(str2, 0))
            Console.WriteLine("Given string is hex-encoded");
        else
            Console.WriteLine("Given string is not hex-encoded");
    }
}

Output

Given string is hex-encoded
Given string is not hex-encoded
Advertisement
Advertisement


Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

Copyright © 2025 www.includehelp.com. All rights reserved.