Transform string to url slug

Here given code implementation process.

// C Program
// Transform string to url slug 
#include <stdio.h>

// This method is returning 1, 
// When the letter is a small character
int is_small_letter(char letter)
{
	if (letter >= 'a' && letter <= 'z')
	{
		return 1;
	}
	return 0;
}
// This method is returning 1, 
// When the letter is a capital character
int is_capital_letter(char letter)
{
	if (letter >= 'A' && letter <= 'Z')
	{
		return 1;
	}
	return 0;
}
// This method is returning 1, 
// When the letter is a number character
int is_number(char letter)
{
	if (letter >= '0' && letter <= '9')
	{
		return 1;
	}
	return 0;
}
void url_slug(char str[], int size)
{
	int location = 0;
	int i = 0;
	printf("\nBefore : [%s]\n", str);
	for (i = 0; i < size; ++i)
	{
		if (is_small_letter(str[i]) == 1 || is_number(str[i]) == 1)
		{
			//When get a valid character letter
			str[location] = str[i];
			location++;
		}
		else if (is_capital_letter(str[i]) == 1)
		{
			//converted into small letter
			str[location] = str[i] + 32;
			location++;
		}
		else if (location > 0 && (location > 0 && str[location - 1] != '-'))
		{
			//When get special alphabet characters
			str[location] = '-';
			location++;
		}
	}
	if (location > 0 && location < size)
	{
		//Add a null character at the resultant string
		if (str[location - 1] == '-')
		{
			//When have last - characters
			str[location - 1] = '\0';
		}
		else
		{
			//try to avoid other existing characters 
			//when print that data
			str[location] = '\0';
		}
	}
	printf("After : [%s]\n", str);
}
int main()
{
	char str1[] = "Learn Programming";
	//Get the size
	int size = sizeof(str1) / sizeof(str1[0]) - 1;
	url_slug(str1, size);
	char str2[] = "  DeTect   This $ LanGuages";
	//Get the size
	size = sizeof(str2) / sizeof(str2[0]) - 1;
	url_slug(str2, size);
	char str3[] = "I am enjoy This T20-20 match";
	//Get the size
	size = sizeof(str3) / sizeof(str3[0]) - 1;
	url_slug(str3, size);
	char str4[] = "please'='No\"%more&^#question''";
	//Get the size
	size = sizeof(str4) / sizeof(str4[0]) - 1;
	url_slug(str4, size);
	return 0;
}

Output

Before : [Learn Programming]
After : [learn-programming]

Before : [  DeTect   This $ LanGuages]
After : [detect-this-languages]

Before : [I am enjoy This T20-20 match]
After : [i-am-enjoy-this-t20-20-match]

Before : [please'='No"%more&^#question'']
After : [please-no-more-question]
/*
  Java Program
  Transform string to url slug 
*/
class MyString
{
	// This method is returning true, 
	// When the letter is a small character
	public boolean is_small_letter(char letter)
	{
		if (letter >= 'a' && letter <= 'z')
		{
			return true;
		}
		//when not a small character
		return false;
	}
	// This method is returning true, 
	// When the letter is a capital character
	public boolean is_capital_letter(char letter)
	{
		if (letter >= 'A' && letter <= 'Z')
		{
			return true;
		}
		//when not a capital character
		return false;
	}
	// This method is returning true, 
	// When the letter is a number character
	public boolean is_number(char letter)
	{
		if (letter >= '0' && letter <= '9')
		{
			return true;
		}
		return false;
	}
	public String url_slug(String str)
	{
		int i = 0;
		int size = str.length();
		System.out.print("\nBefore String : [" + str + "]\n");
		String result = "";
		boolean flag = false;
		for (i = 0; i < size; ++i)
		{
			if (is_small_letter(str.charAt(i)) || is_number(str.charAt(i)))
			{
				if (flag == true && result.length() > 0 && result.charAt(result.length() - 1) != '-')
				{
					//add separator
					result += '-';
				}
				//When get a valid character letter
				result += str.charAt(i);
				flag = false;
			}
			else if (is_capital_letter(str.charAt(i)))
			{
				if (flag == true && result.length() > 0 && result.charAt(result.length() - 1) != '-')
				{
					//add separator
					result += '-';
				}
				//converted into small letter
				result += (char)(str.charAt(i) + 32);
				flag = false;
			}
			else
			{
				//When get special alphabet characters
				flag = true;
			}
		}
		return result;
	}
	public static void main(String[] args)
	{
		MyString obj = new MyString();
		String text = "Learn Programming";
		text = obj.url_slug(text);
		System.out.print("After result : [" + text + "]\n");
		text = "  DeTect   This $ LanGuages";
		text = obj.url_slug(text);
		System.out.print("After result : [" + text + "]\n");
		text = "I am enjoy This T20-20 match";
		text = obj.url_slug(text);
		System.out.print("After result : [" + text + "]\n");
		text = "please'='No\"%more&^#question''";
		text = obj.url_slug(text);
		System.out.print("After result : [" + text + "]\n");
	}
}

Output

Before String : [Learn Programming]
After result : [learn-programming]

Before String : [  DeTect   This $ LanGuages]
After result : [detect-this-languages]

Before String : [I am enjoy This T20-20 match]
After result : [i-am-enjoy-this-t20-20-match]

Before String : [please'='No"%more&^#question'']
After result : [please-no-more-question]
/*
  C++ Program
  Transform string to url slug 
*/
#include<iostream>
#include<string.h>
using namespace std;
class MyString
{
	public:
		// This method is returning true, 
		// When the letter is a small character
		bool is_small_letter(char letter)
		{
			if (letter >= 'a' && letter <= 'z')
			{
				return true;
			}
			return
			//when not a small character
			false;
		}
	// This method is returning true, 
	// When the letter is a capital character
	bool is_capital_letter(char letter)
	{
		if (letter >= 'A' && letter <= 'Z')
		{
			return true;
		}
		return
		//when not a capital character
		false;
	}
	// This method is returning true, 
	// When the letter is a number character
	bool is_number(char letter)
	{
		if (letter >= '0' && letter <= '9')
		{
			return true;
		}
		return false;
	}
	string url_slug(string str)
	{
		int i = 0;
		int size = str.size();
		cout << "\nBefore String : [" << str << "]\n";
		string result = "";
		bool flag = false;
		for (i = 0; i < size; ++i)
		{
			if (this->is_small_letter(str[i]) || this->is_number(str[i]))
			{
				if (flag == true && result.size() > 0 && result[result.size() - 1] != '-')
				{
					//add separator
					result += '-';
				}
				//When get a valid character letter
				result += str[i];
				flag = false;
			}
			else if (this->is_capital_letter(str[i]))
			{
				if (flag == true && result.size() > 0 && result[result.size() - 1] != '-')
				{
					//add separator
					result += '-';
				}
				//converted into small letter
				result += (char)(str[i] + 32);
				flag = false;
			}
			else
			{
				//When get special alphabet characters
				flag = true;
			}
		}
		return result;
	}
};
int main()
{
	MyString obj =  MyString();
	string text = "Learn Programming";
	text = obj.url_slug(text);
	cout << "After result : [" << text << "]\n";
	text = " DeTect This $ LanGuages";
	text = obj.url_slug(text);
	cout << "After result : [" << text << "]\n";
	text = "I am enjoy This T20-20 match";
	text = obj.url_slug(text);
	cout << "After result : [" << text << "]\n";
	text = "please'='No\"%more&^#question''";
	text = obj.url_slug(text);
	cout << "After result : [" << text << "]\n";
	return 0;
}

Output

Before String : [Learn Programming]
After result : [learn-programming]

Before String : [ DeTect This $ LanGuages]
After result : [detect-this-languages]

Before String : [I am enjoy This T20-20 match]
After result : [i-am-enjoy-this-t20-20-match]

Before String : [please'='No"%more&^#question'']
After result : [please-no-more-question]
/*
  C# Program
  Transform string to url slug 
*/
using System;
class MyString
{
	// When the letter is a small character
	// This method is returning true, 
	public Boolean is_small_letter(char letter)
	{
		//when not a small character
		if (letter >= 'a' && letter <= 'z')
		{
			return true;
		}
		return false;
	}
	// When the letter is a capital character
	// This method is returning true, 
	public Boolean is_capital_letter(char letter)
	{
		//when not a capital character
		if (letter >= 'A' && letter <= 'Z')
		{
			return true;
		}
		return false;
	}
	// When the letter is a number character
	// This method is returning true, 
	public Boolean is_number(char letter)
	{
		if (letter >= '0' && letter <= '9')
		{
			return true;
		}
		return false;
	}
	public String url_slug(String str)
	{
		int i = 0;
		int size = str.Length;
		Console.Write("\nBefore String : [" + str + "]\n");
		String result = "";
		Boolean flag = false;
		for (i = 0; i < size; i++)
		{
			if (is_small_letter(str[i]) || is_number(str[i]))
			{
				if (flag == true && result.Length > 0 && result[result.Length - 1] != '-')
				{
					//add separator
					result += '-';
				}
				//When get a valid character letter
				result += str[i];
				flag = false;
			}
			else if (is_capital_letter(str[i]))
			{
				if (flag == true && result.Length > 0 && result[result.Length - 1] != '-')
				{
					//add separator
					result += '-';
				}
				//converted into small letter
				result += (char)(str[i] + 32);
				flag = false;
			}
			else
			{
				//When get special alphabet characters
				flag = true;
			}
		}
		return result;
	}
	public static void Main(String[] args)
	{
		MyString obj = new MyString();
		String text = "Learn Programming";
		text = obj.url_slug(text);
		Console.Write("After result : [" + text + "]\n");
		text = " DeTect This $ LanGuages";
		text = obj.url_slug(text);
		Console.Write("After result : [" + text + "]\n");
		text = "I am enjoy This T20-20 match";
		text = obj.url_slug(text);
		Console.Write("After result : [" + text + "]\n");
		text = "please'='No\"%more&^#question''";
		text = obj.url_slug(text);
		Console.Write("After result : [" + text + "]\n");
	}
}

Output

Before String : [Learn Programming]
After result : [learn-programming]

Before String : [ DeTect This $ LanGuages]
After result : [detect-this-languages]

Before String : [I am enjoy This T20-20 match]
After result : [i-am-enjoy-this-t20-20-match]

Before String : [please'='No"%more&^#question'']
After result : [please-no-more-question]
<?php
/*
  Php Program
  Transform string to url slug 
*/
class MyString
{
	// This method is returning true, 
	// When the letter is a small character
	public	function is_small_letter($letter)
	{
		if (ord($letter) >= ord('a') && ord($letter) <= ord('z'))
		{
			return true;
		}
		return false;
	}
	// This method is returning true, 
	// When the letter is a capital character
	public	function is_capital_letter($letter)
	{
		if (ord($letter) >= ord('A') && ord($letter) <= ord('Z'))
		{
			return true;
		}
		return false;
	}
	// This method is returning true, 
	// When the letter is a number character
	public	function is_number($letter)
	{
		if (ord($letter) >= ord('0') && ord($letter) <= ord('9'))
		{
			return true;
		}
		return false;
	}
	public	function url_slug($str)
	{
		$i = 0;
		$size = strlen($str);
		echo("\nBefore String : [". $str ."]\n");
		$result = "";
		$flag = false;
		for ($i = 0; $i < $size; ++$i)
		{
			if ($this->is_small_letter($str[$i]) || $this->is_number($str[$i]))
			{
				if ($flag == true && strlen($result) > 0 && $result[strlen($result) - 1] != '-')
				{
					//add separator
					$result .= '-';
				}
				//When get a valid character letter
				$result .= $str[$i];
				$flag = false;
			}
			else if ($this->is_capital_letter($str[$i]))
			{
				if ($flag == true && strlen($result) > 0 && $result[strlen($result) - 1] != '-')
				{
					//add separator
					$result .= '-';
				}
				//converted into small letter
				$result .= chr(ord($str[$i]) + 32);
				$flag = false;
			}
			else
			{
				//When get special alphabet characters
				$flag = true;
			}
		}
		return $result;
	}
}

function main()
{
	$obj = new MyString();
	$text = "Learn Programming";
	$text = $obj->url_slug($text);
	echo("After result : [". $text ."]\n");
	$text = " DeTect This $ LanGuages";
	$text = $obj->url_slug($text);
	echo("After result : [". $text ."]\n");
	$text = "I am enjoy This T20-20 match";
	$text = $obj->url_slug($text);
	echo("After result : [". $text ."]\n");
	$text = "please'='No\"%more&^#question''";
	$text = $obj->url_slug($text);
	echo("After result : [". $text ."]\n");
}
main();

Output

Before String : [Learn Programming]
After result : [learn-programming]

Before String : [ DeTect This $ LanGuages]
After result : [detect-this-languages]

Before String : [I am enjoy This T20-20 match]
After result : [i-am-enjoy-this-t20-20-match]

Before String : [please'='No"%more&^#question'']
After result : [please-no-more-question]
/*
  Node Js Program
  Transform string to url slug 
*/
class MyString
{
	// This method is returning true, 
	// When the letter is a small character
	is_small_letter(letter)
	{
		if ((letter).charCodeAt(0) >= ('a').charCodeAt(0) && (letter).charCodeAt(0) <= ('z').charCodeAt(0))
		{
			return true;
		}
		return false;
	}
	// This method is returning true, 
	// When the letter is a capital character
	is_capital_letter(letter)
	{
		if ((letter).charCodeAt(0) >= ('A').charCodeAt(0) && (letter).charCodeAt(0) <= ('Z').charCodeAt(0))
		{
			return true;
		}
		return false;
	}
	// This method is returning true, 
	// When the letter is a number character
	is_number(letter)
	{
		if ((letter).charCodeAt(0) >= ('0').charCodeAt(0) && (letter).charCodeAt(0) <= ('9').charCodeAt(0))
		{
			return true;
		}
		return false;
	}
	url_slug(str)
	{
		var i = 0;
		var size = str.length;
		process.stdout.write("\nBefore String : [" + str + "]\n");
		var result = "";
		var flag = false;
		for (i = 0; i < size; ++i)
		{
			if (this.is_small_letter(str[i]) || this.is_number(str[i]))
			{
				if (flag == true && result.length > 0 && result[result.length - 1] != '-')
				{
					//add separator
					result += '-';
				}
				//When get a valid character letter
				result += str[i];
				flag = false;
			}
			else if (this.is_capital_letter(str[i]))
			{
				if (flag == true && result.length > 0 && result[result.length - 1] != '-')
				{
					//add separator
					result += '-';
				}
				//converted into small letter
				result += String.fromCharCode((str.charCodeAt(i) + 32));
				flag = false;
			}
			else
			{
				//When get special alphabet characters
				flag = true;
			}
		}
		return result;
	}
}

function main(args)
{
	var obj = new MyString();
	var text = "Learn Programming";
	text = obj.url_slug(text);
	process.stdout.write("After result : [" + text + "]\n");
	text = " DeTect This $ LanGuages";
	text = obj.url_slug(text);
	process.stdout.write("After result : [" + text + "]\n");
	text = "I am enjoy This T20-20 match";
	text = obj.url_slug(text);
	process.stdout.write("After result : [" + text + "]\n");
	text = "please'='No\"%more&^#question''";
	text = obj.url_slug(text);
	process.stdout.write("After result : [" + text + "]\n");
}
main();

Output

Before String : [Learn Programming]
After result : [learn-programming]

Before String : [ DeTect This $ LanGuages]
After result : [detect-this-languages]

Before String : [I am enjoy This T20-20 match]
After result : [i-am-enjoy-this-t20-20-match]

Before String : [please'='No"%more&^#question'']
After result : [please-no-more-question]
#   Python 3 Program
#   Transform string to url slug 

class MyString :
	#  This method is returning true, 
	#  When the letter is a small character
	def is_small_letter(self, letter) :
		if (ord(letter) >= ord('a') and ord(letter) <= ord('z')) :
			return True
		
		return False
	
	#  This method is returning true, 
	#  When the letter is a capital character
	def is_capital_letter(self, letter) :
		if (ord(letter) >= ord('A') and ord(letter) <= ord('Z')) :
			return True
		
		return False
	
	#  This method is returning true, 
	#  When the letter is a number character
	def is_number(self, letter) :
		if (ord(letter) >= ord('0') and ord(letter) <= ord('9')) :
			return True
		
		return False
	
	def url_slug(self, str) :
		i = 0
		size = len(str)
		print("\nBefore String : [{0}]\n".format(str))
		result = ""
		flag = False
		i = 0
		while (i < size) :
			if (self.is_small_letter(str[i]) or self.is_number(str[i])) :
				if (flag == True and len(result) > 0 and result[len(result) - 1] != '-') :
					# add separator
					result += '-'
				
				# When get a valid character letter
				result += str[i]
				flag = False
			
			elif(self.is_capital_letter(str[i])) :
				if (flag == True and len(result) > 0 and result[len(result) - 1] != '-') :
					# add separator
					result += '-'
				
				# converted into small letter
				result += chr(ord(str[i]) + 32)
				flag = False
			else :
				# When get special alphabet characters
				flag = True
			
			i += 1
		
		return result
	

def main() :
	obj = MyString()
	text = "Learn Programming"
	text = obj.url_slug(text)
	print("After result : [{0}]".format(text))
	text = " DeTect This $ LanGuages"
	text = obj.url_slug(text)
	print("After result : [{0}]".format(text))
	text = "I am enjoy This T20-20 match"
	text = obj.url_slug(text)
	print("After result : [{0}]".format(text))
	text = "please'='No\"%more&^#question''"
	text = obj.url_slug(text)
	print("After result : [{0}]".format(text))


if __name__ == "__main__": main()

Output

Before String : [Learn Programming]

After result : [learn-programming]

Before String : [ DeTect This $ LanGuages]

After result : [detect-this-languages]

Before String : [I am enjoy This T20-20 match]

After result : [i-am-enjoy-this-t20-20-match]

Before String : [please'='No"%more&^#question'']

After result : [please-no-more-question]
#   Ruby Program
#   Transform string to url slug 

class MyString

	#  This method is returning true, 
	#  When the letter is a small character
	def is_small_letter(letter)
	
		if ((letter).ord >= ('a').ord && (letter).ord <= ('z').ord)
		
			return true
		end
		return false
	end
	#  This method is returning true, 
	#  When the letter is a capital character
	def is_capital_letter(letter)
	
		if ((letter).ord >= ('A').ord && (letter).ord <= ('Z').ord)
		
			return true
		end
		return false
	end
	#  This method is returning true, 
	#  When the letter is a number character
	def is_number(letter)
	
		if ((letter).ord >= ('0').ord && (letter).ord <= ('9').ord)
		
			return true
		end
		return false
	end
	def url_slug(str)
	
		i = 0
		size = str.length()
		print("\nBefore String : [", str ,"]\n")
		result = ""
		flag = false
		i = 0
		while (i < size)
		
			if (self.is_small_letter(str[i]) || self.is_number(str[i]))
			
				if (flag == true && result.length() > 0 && result[result.length() - 1] != '-')
				
					# add separator
					result += '-'
				end
				# When get a valid character letter
				result += str[i]
				flag = false
			elsif(self.is_capital_letter(str[i]))
			
				if (flag == true && result.length() > 0 && result[result.length() - 1] != '-')
				
					# add separator
					result += '-'
				end
				# converted into small letter
				result += ((str[i].ord + 32)).chr
				flag = false
			else
			
				# When get special alphabet characters
				flag = true
			end
			i += 1
		end
		return result
	end
end
def main()

	obj = MyString.new()
	text = "Learn Programming"
	text = obj.url_slug(text)
	print("After result : [", text ,"]\n")
	text = " DeTect This $ LanGuages"
	text = obj.url_slug(text)
	print("After result : [", text ,"]\n")
	text = "I am enjoy This T20-20 match"
	text = obj.url_slug(text)
	print("After result : [", text ,"]\n")
	text = "please'='No\"%more&^#question''"
	text = obj.url_slug(text)
	print("After result : [", text ,"]\n")
end
main()

Output

Before String : [Learn Programming]
After result : [learn-programming]

Before String : [ DeTect This $ LanGuages]
After result : [detect-this-languages]

Before String : [I am enjoy This T20-20 match]
After result : [i-am-enjoy-this-t20-20-match]

Before String : [please'='No"%more&^#question'']
After result : [please-no-more-question]
/*
  Scala Program
  Transform string to url slug 
*/
class MyString
{
	// This method is returning true, 
	// When the letter is a small character
	def is_small_letter(letter: Char): Boolean = {
		if (letter >= 'a' && letter <= 'z')
		{
			return true;
		}
		return false;
	}
	// This method is returning true, 
	// When the letter is a capital character
	def is_capital_letter(letter: Char): Boolean = {
		if (letter >= 'A' && letter <= 'Z')
		{
			return true;
		}
		return false;
	}
	// This method is returning true, 
	// When the letter is a number character
	def is_number(letter: Char): Boolean = {
		if (letter >= '0' && letter <= '9')
		{
			return true;
		}
		return false;
	}
	def url_slug(str: String): String = {
		var i: Int = 0;
		var size: Int = str.length();
		print("\nBefore String : [" + str + "]\n");
		var result: String = "";
		var flag: Boolean = false;
		i = 0;
		while (i < size)
		{
			if (is_small_letter(str(i)) || is_number(str(i)))
			{
				if (flag == true && result.length() > 0 && result(result.length() - 1) != '-')
				{
					//add separator
					result += '-';
				}
				//When get a valid character letter
				result += str(i);
				flag = false;
			}
			else if (is_capital_letter(str(i)))
			{
				if (flag == true && result.length() > 0 && result(result.length() - 1) != '-')
				{
					//add separator
					result += '-';
				}
				//converted into small letter
				result += ((str(i) + 32)).toChar;
				flag = false;
			}
			else
			{
				//When get special alphabet characters
				flag = true;
			}
			i += 1;
		}
		return result;
	}
}
object Main
{
	def main(args: Array[String]): Unit = {
		var obj: MyString = new MyString();
		var text: String = "Learn Programming";
		text = obj.url_slug(text);
		print("After result : [" + text + "]\n");
		text = " DeTect This $ LanGuages";
		text = obj.url_slug(text);
		print("After result : [" + text + "]\n");
		text = "I am enjoy This T20-20 match";
		text = obj.url_slug(text);
		print("After result : [" + text + "]\n");
		text = "please'='No\"%more&^#question''";
		text = obj.url_slug(text);
		print("After result : [" + text + "]\n");
	}
}

Output

Before String : [Learn Programming]
After result : [learn-programming]

Before String : [ DeTect This $ LanGuages]
After result : [detect-this-languages]

Before String : [I am enjoy This T20-20 match]
After result : [i-am-enjoy-this-t20-20-match]

Before String : [please'='No"%more&^#question'']
After result : [please-no-more-question]
/*
  Swift Program
  Transform string to url slug 
*/
class MyString
{
	// This method is returning true, 
	// When the letter is a small character
	func is_small_letter(_ letter: Character) -> Bool
	{
		if (letter >= "a" && letter <= "z")
		{
			return true;
		}
		return false;
	}
	// This method is returning true, 
	// When the letter is a capital character
	func is_capital_letter(_ letter: Character) -> Bool
	{
		if (letter >= "A" && letter <= "Z")
		{
			return true;
		}
		return false;
	}
	// This method is returning true, 
	// When the letter is a number character
	func is_number(_ letter: Character) -> Bool
	{
		if (letter >= "0" && letter <= "9")
		{
			return true;
		}
		return false;
	}
	func url_slug(_ data: String) -> String
	{	
        var str = Array(data);
		var i: Int = 0;
		let size: Int = str.count;
		print("\nBefore String : [\(data)]");
		var result: String = "";
		var flag: Bool = false;
		i = 0;
		while (i < size)
		{
			if (self.is_small_letter(str[i]) || self.is_number(str[i]))
			{
				if (flag == true && result.count > 0 )
				{
					//add separator
					result += "-";
				}
				//When get a valid character letter
				result += String(str[i]);
				flag = false;
			}
			else if (self.is_capital_letter(str[i]))
			{
				if (flag == true && result.count > 0 )
				{
					//add separator
					result += "-";
				}
				//converted into small letter
				result += String(UnicodeScalar(UInt8(UnicodeScalar(String(str[i]))!.value  + 32)));
				flag = false;
			}
			else
			{
				//When get special alphabet characters
				flag = true;
			}
			i += 1;
		}
		return result;
	}
}
func main()
{
	let obj: MyString = MyString();
	var text: String = "Learn Programming";
	text = obj.url_slug(text);
	print("After result : [\(text)" , terminator: "]\n");
	text = " DeTect This $ LanGuages";
	text = obj.url_slug(text);
	print("After result : [\(text)" , terminator: "]\n");
	text = "I am enjoy This T20-20 match";
	text = obj.url_slug(text);
	print("After result : [\(text)" , terminator: "]\n");
	text = "please'='No\"%more&^#question''";
	text = obj.url_slug(text);
	print("After result : [\(text)" , terminator: "]\n");
}
main();

Output

Before String : [Learn Programming]
After result : [learn-programming]

Before String : [ DeTect This $ LanGuages]
After result : [detect-this-languages]

Before String : [I am enjoy This T20-20 match]
After result : [i-am-enjoy-this-t20-20-match]

Before String : [please'='No"%more&^#question'']
After result : [please-no-more-question]


Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.

New Comment







© 2021, kalkicode.com, All rights reserved