Page 1 of 1

Functions

PostPosted: Mon May 29, 2017 5:59 am
by StarterPack
Hi guys, I need a Call function to Capitalize the first letter in a word in each line.

Example:
this is the first line
and this is the second line
but this is the third line

This is the first line
And this is the second line
But this is the third line

Also, is there another site where we can download call functions other then Neobook Resource Center
Appreciate, Thank You

Re: Functions

PostPosted: Mon May 29, 2017 7:35 am
by Gaev
StarterPack:

There might already be a plugin for this ... but if you didn't find it ...

1) split the variable into an array ... where each element is a line ... use StrParse and separate using [#13][#10]

2) then Loop through each element ...
a) replacing the first letter (using SubString) with its UpperCase
b) add the upper-cased element to a new variable (prefixed with [#13[#10])

3) remove the first (extraneous) [#13][#10] from the new variable

Re: Functions

PostPosted: Mon May 29, 2017 9:18 am
by virger
Yo uso esta funcion
Call "Capitalice "pura Vida desde Aqui"
....Pura Vida desde aqui

Code: Select all
{NeoBook Function}
Version=5,80
Language=JScript
Param=[%Tx]|Variable|Texto A Capitalizar
{End}
var tx = nbGetVar("[%Tx]");
nbSetVar("[%Tx]" ,tx.charAt(0).toUpperCase() + tx.slice(1));