Text functions: replace Instructions: replacereplace <text_ref>, <oldtext>, <newtext>
Text functions: replace Instructions: replaceReplace in <text_ref> any occurance of <oldtext> with <newtext>. Flow control: if … then Flow control: try … thenThe target Data Types: Text Item selector "[]": Text Glossary: text, text_valtext Glossary: Variable, var_refvariable is overwritten with Flow control: if … then Flow control: try … thenthe result of Flow control: if … then Flow control: try … thenthe conversion.
Flow control: if … then Flow control: try … thenThe source Data Types: Text Item selector "[]": Text Glossary: text, text_valtext is scanned from left to right Operators: Boolean And with Variable "&&=" Operators: Bitwise And with Variable "&=" Operators: Bitwise And "&" Operators: Boolean And "&&"and replaced Data Types: Text Item selector "[]": Text Glossary: text, text_valtext is Operators: Bitwise Not "~" Operators: Boolean Negation "!"not scanned again. Flow control: if … then Flow control: if … thenIf the search Data Types: Text Item selector "[]": Text Glossary: text, text_valtext <oldtext> is an empty Data Types: Text Text functions: stringstring, Flow control: if … then Flow control: try … thenthen nothing is done.
Version 0.8.7: Text functions: replace Instructions: replacereplace Flow control: do … loopdoes Operators: Bitwise Not "~" Operators: Boolean Negation "!"not yet work on Data Types: Lists and arrays Item selector "[]": Lists Glossary: list, list_vallists. List functions: thisthis will be added in Flow control: if … then Flow control: try … thenthe near future.
There is also a Vipsi command syntax: Functions Functions Glossary: Functionfunction Text functions: replace Instructions: replacereplace which Flow control: returnreturns Flow control: if … then Flow control: try … thenthe modified Data Types: Text Item selector "[]": Text Glossary: text, text_valtext.
e.g.:
Text functions: replace Instructions: replacereplace html_file, old_homepage, new_homepage
|