CharAt(str, pos)
Last updated August 27, 2001
Version: 1 | Requires: ColdFusion 5 | Library: StrLib
Description:
Returns the character at a certain position in a string.
Return Values:
Returns a character.
Example:
<CFOUTPUT>
2nd char: #CharAt(Str,2)#<BR>
4th char: #CharAt(Str,4)#<BR>
6th char: #CharAt(Str,6)#<BR>
8th char: #CharAt(Str,8)#<BR>
</CFOUTPUT>
Parameters:
| Name | Description | Required |
|---|---|---|
| str | String to be checked. | Yes |
| pos | Position to get character from. | Yes |
Full UDF Source:
<cfscript>
/**
* Returns the character at a certain position in a string.
*
* @param str String to be checked.
* @param pos Position to get character from.
* @return Returns a character.
* @author Raymond Camden (ray@camdenfamily.com)
* @version 1, December 3, 2001
*/
function CharAt(str,pos) {
return Mid(str,pos,1);
}
</cfscript>
Search CFLib.org
Latest Additions
Ryan Thompson-Jewell added
ListSplit
3 day(s) ago
Nathan Dintenfass added
RowsToColumns
4 day(s) ago
Barney Boisvert added
indentXml
4 day(s) ago
Barney Boisvert added
REReplaceCallbac...
4 day(s) ago
Top Rated
FolderSize
Rated 5.0, 7 time(s)
UniqueValueList
Rated 5.0, 6 time(s)
QuickSort
Rated 5.0, 3 time(s)
ListDeleteDuplic...
Rated 5.0, 3 time(s)