aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/str
diff options
context:
space:
mode:
authorGravatar Noldor2008-09-12 17:04:38 +0000
committerGravatar Noldor2008-09-12 17:04:38 +0000
commit7116e28ddf63e6f7772f7fa7430599a251ccee57 (patch)
tree9807dd544e6185d4a0bf7486c9c92f5260a90ebe /src/modules/str
parentquick fix (diff)
downloadKVIrc-7116e28ddf63e6f7772f7fa7430599a251ccee57.tar.gz
KVIrc-7116e28ddf63e6f7772f7fa7430599a251ccee57.tar.bz2
KVIrc-7116e28ddf63e6f7772f7fa7430599a251ccee57.zip
other small fixes
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2448 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/str')
-rw-r--r--src/modules/str/libkvistr.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/str/libkvistr.cpp b/src/modules/str/libkvistr.cpp
index 8b046be0a..1519ea108 100644
--- a/src/modules/str/libkvistr.cpp
+++ b/src/modules/str/libkvistr.cpp
@@ -624,7 +624,7 @@ static bool str_kvs_fnc_find(KviKvsModuleFunctionCall * c)
@short:
Find the index of a substring in a string
@syntax:
- <int> $str.findfirst(<findIn:string>,<toFind:string>)
+ <int> $str.findfirst(<findIn:string>,<toFind:string>,[<start_index:integer>])
@description:
This function search in the string given as the first parameter for the string
given as his second parameter, and will return the index where is first located or
@@ -634,11 +634,13 @@ static bool str_kvs_fnc_find(KviKvsModuleFunctionCall * c)
static bool str_kvs_fnc_findfirst(KviKvsModuleFunctionCall * c)
{
QString szString,szString2;
+ kvs_int_t iFromIndex;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("findIn",KVS_PT_STRING,0,szString)
KVSM_PARAMETER("toFind",KVS_PT_STRING,0,szString2)
+ KVSM_PARAMETER("from_index",KVS_PT_INTEGER,KVS_PF_OPTIONAL,iFromIndex)
KVSM_PARAMETERS_END(c)
- c->returnValue()->setInteger(szString.indexOf(szString2));
+ c->returnValue()->setInteger(szString.indexOf(szString2,iFromIndex));
return true;
}
/*