String Jargon in C# zz

http://www.c-sharpcorner.com/UploadFile/prasad_1/StringJargonPSD12062005020601AM/StringJargonPSD.aspx

Description 

The following article shows solinkme String functions which are not currently available directly in C#.
 
PCase
 
This will conver the string passed to ProperCase ie each word's first is changed to UpperCase().The word is identified using whitespace character such as " ","\t","\n","\r".

Usage: PCase(string)   
 
Replace
 
Currently in C# it does not support Replace() function for string even stringbuilder Replace() also does character replacement and not string replacement. This function will find the characters passed in the second argument with the source string in first argument and replace it with 3rd argument.
 
Usage: Replace(Source,Find,Replacement) 
eg. Replace("abc","b","d") will return "adc" 
 
ToSingleSpace

ToSingleSpace is a function which will trims off multiple whitespace characters to single whitespace characters.
   
Usage:ToSingleSpace(SourceString) 
eg.ToSingleSpace("Welcome    to     C#") will return "Welcome to C#" 
  
CharCount 
 
This CharCount will no. of occurrences of a sub string in the main string. This will be useful in parsing functions.

Usage:CharCount(Source,Find) 
eg.CharCount("aaaaac","a")  will return 5
 
Reverse

This will reverse the String argument passed and return it.

Usage:Reverse(Source) 
eg.Reverse("abc") will return "cba" 
 
Left 
 
This will returns certain no.of characters from the beginning of the string. 

Usage:Left(Source,CharCount) 
eg. Left("Welcome",3) will return "Wel" 
  
Right
 
This will return certain no.of characters from the end of the String.

Usage:Right(Source,CharCount)  
eg. Right("Welcome",2) will return "me" 
 
IsPalindrome
 
This function will return whether the passed string is palindrome or not.
 
Usage:IsPalindrome(Source)  
eg.IsPalindrome("abc") will return false wherease IsPalindrome("121") will return true.

zip

转载于:https://www.cnblogs.com/ekeen/archive/2007/07/17/821676.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值