Source language: Translate to:

Functions

General questions about NeoBook

Moderator: Neosoft Support

Functions

Postby StarterPack » Mon May 29, 2017 5:59 am

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
StarterPack
 
Posts: 115
Joined: Fri Feb 19, 2016 6:55 am

Re: Functions

Postby Gaev » Mon May 29, 2017 7:35 am

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
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Functions

Postby virger » Mon May 29, 2017 9:18 am

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));
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 510
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 2 guests