Difference between revisions of "Charat"

From Mesham
Jump to navigationJump to search
(Created page with '== Overview == This charat[s,n] function will return the character at position ''n'' of the string ''s''. * '''Pass:''' A string and integer * '''Returns:''' A character == Ex…')
 
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
  
This charat[s,n] function will return the character at position ''n'' of the string ''s''.
+
This charat(s,n) function will return the character at position ''n'' of the string ''s''.
  
* '''Pass:''' A string and integer
+
* '''Pass:''' A [[String]] and [[Int]]
* '''Returns:''' A character
+
* '''Returns:''' A [[Char]]
  
 
== Example ==
 
== Example ==
  
 +
#include <string>
 
  var a:="hello";
 
  var a:="hello";
  var c:=charat[a,2];
+
  var c:=charat(a,2);
 +
var d:=charat("test",0);
  
 
[[Category:Function Library]]
 
[[Category:Function Library]]
 
[[Category:String Functions]]
 
[[Category:String Functions]]

Revision as of 13:18, 13 January 2013

Overview

This charat(s,n) function will return the character at position n of the string s.

Example

#include <string>
var a:="hello";
var c:=charat(a,2);
var d:=charat("test",0);