Contents:

 

 

Introduction


News blog


What is Servoy?


Getting Started


Comparison Servoy/VFP


Performance


How-To's

 

Code Reference

 

VFP2Servoy Toolkit

 

 

Contact / feedback

 

 

 

 

 

 

 

 

 

 

 

 

 

 

STRTRAN() - utils.stringReplace()



Searches a character expression for a second character expression and replaces each occurrence with a third character expression.

 

VFP code example


? STRTRAN("Hello World", "Hello", "Servoy")  && returns Servoy World

 

Servoy code example


var
cString = utils.stringReplace("Hello World", "Hello", "Servoy");
application.output(cString);  

// outputs  Servoy World


NOTE! There is also a string.replace() function but if you use this the way you are used to it will only replace the first occurrence of the searchstring! This is because it expects a regular expression instead of a string as a first parameter!

We don't have regular expressions in Visual FoxPro but they are very powerful and you will benefit greatly if you learn how to use them!

Here's a quick tutorial on how to use regular expressions and here are some examples.

Note: STRTRAN() is a function of the VFP2Servoy Toolkit

 

 

External resources:

 

vfp plugin

 

ServoyWorld 2012 pics

 

Official Servoy website

 

Ken Levy on Servoy

 

Servoy info

 

Servoy Forum

 

Servoy Documentation

 

VisualFoxpro.com © 2010-2012 • All rights reserved • Contact: info@visualfoxpro.com