Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
Python, Lua and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Java, C, C++, Ruby, MySQL and Linux / Tomcat systems

Phone System reconfiguration 11.1.2018 and 12.1.2018 - we are on email but incoming phone not available all the time
 

Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
Lua module U104
Strings and the String library.
Exercises, examples and other material relating to training module U104. This topic is presented on public courses Learning to program in Lua, Lua Programming, Lua Programming




Articles and tips on this subjectupdated
4274String formatting in Lua - string.format as a wrapper for sprintf
Lua is a small language - and so for some elements of its functionallity it uses wrappers around underlying C functions rather than re-implementing and duplicating logic. A good example is the string.format function which in essence is a wrapper around sprintf. For example:   thing = string.format("> ...
2014-05-07
 
2500Dynamically formatting your results (Lua)
Scenario: You're producing a short (text) table of results and you want to keep it reasonably small - not a great deal of white space, but the data in some of your columns differs dramatically from one set of results to another. How can you do it? Discussion: You can use your traditional "printf" ...
2009-11-11
 
2357Checking if the user has entered a number (Lua)
In Lua, there's a difference between 0 and nil - and that means that you can easily code to ask your user to enter a number, testing the result and allowing him to enter zero as a legitimate value. That may sound like it's no big deal, but you don't want a loop to exit on a premature 0. Here's code ...
2009-08-14
 
2348Finding literals rather than patterns in Lua
Lua's string.find looks for a PATTERN ... it's not as big an sophisticated as a regular expression match (but then it's got nothing like as big a footprint!), but neither is it a literal match. So if I want to search a string for - literally - a ".", I need to protect it. I can do this either with ...
2009-08-11
 
1744Lua examples, Lua Courses
Programming training is much more effective if the delegates are shown how a particular program is written, rather than just the final result ... show them just the final result and they'll ask "but how did you come up with that?" So whenever possible, I write new examples in front of my delegates - ...
2008-08-09
 
Examples from our training material
ee   Excercise to print out exchange rate table
gimme   Reading from the keyboard and string basics
kiddos   Spread money gift around a group of children
kids   String formatting
mlx   Single and multiline strings
moopark   Answer to excercise - Theme park takings
qbs   backslash specials in character strings and other basics
s2   Finding literal strings
sf   string.format
splitter   Using string.find and string.sub to split
stem   Basic String functionality
three   Wait until a NUMBER has been entered
two   Checking a NUMBER has been entered
ul   Use of string.rep
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from [here].
Topics covered in this module
Double and single quotes, square brackets and backslashes.
String concat, length, etc
Formatting numbers in to strings.
String Conversion Functions.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Ruby, Lua, Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 700 books on the subjects on which we teach. These books are available for reference at our training centre.


You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2018: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/U104.html • PAGE BUILT: Mon Feb 8 18:55:24 2016 • BUILD SYSTEM: WomanWithCat