com.google.clearsilver.jsilver.functions.string
Class FindFunction

java.lang.Object
  extended by com.google.clearsilver.jsilver.functions.NonEscapingFunction
      extended by com.google.clearsilver.jsilver.functions.string.FindFunction
All Implemented Interfaces:
Function

public class FindFunction
extends NonEscapingFunction

Returns the numeric position of the substring in the string (if found), otherwise returns -1 similar to the Python string.find method.


Constructor Summary
FindFunction()
           
 
Method Summary
 Value execute(Value... args)
          Execute a function.
 
Methods inherited from class com.google.clearsilver.jsilver.functions.NonEscapingFunction
isEscapingFunction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindFunction

public FindFunction()
Method Detail

execute

public Value execute(Value... args)
Description copied from interface: Function
Execute a function. Should always return a result.

Parameters:
args - 2 string expressions (full string and substring)
Returns:
Position of the start of substring (or -1 if not found) as number value


Copyright © 2010-2012 Google. All Rights Reserved.