2004-02-07 00:39:42 +00:00
|
|
|
String Functions Header File Readme
|
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
String Functions Header File contains a set of good string manipulation
|
|
|
|
functions in a much simpler way to include and call in NSIS scripts.
|
|
|
|
|
|
|
|
How to use
|
|
|
|
----------
|
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
Basic Syntax
|
|
|
|
------------
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
Parameters are specified in this format:
|
|
|
|
required (required) (option1 | option2) [optional]
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
The stars in command titles (*****) are the function usefulness in my
|
2004-04-09 13:17:55 +00:00
|
|
|
opinion. The more starts, the most useful it is. 5 stars (*****) is much
|
|
|
|
useful.
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
Any time when is mentioned "Default is" means that you can use the value
|
2004-06-25 20:00:50 +00:00
|
|
|
mentioned or keep it blank, the result is the same.
|
2004-02-07 15:47:54 +00:00
|
|
|
|
2004-02-07 00:39:42 +00:00
|
|
|
If you want a certain value (e.g. a text) to be language-specific, set a
|
|
|
|
language string (using LangString) and define $(STRINGNAME) as value.
|
|
|
|
|
|
|
|
If you want to add ` to a string, you should always escape it using $\`
|
|
|
|
because the header file macro functions use ` to separate parameters.
|
|
|
|
|
|
|
|
1. Include Header file
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
!include "StrFunc.nsh"
|
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
StrFunc.nsh has to be inside Include directory, so you don't have to
|
2004-02-07 00:39:42 +00:00
|
|
|
specify a path.
|
|
|
|
|
|
|
|
You have to put this command before any command used in this header file.
|
|
|
|
|
|
|
|
2. Commands
|
|
|
|
-----------
|
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
Some commands have special specifications to work. Consult command's
|
|
|
|
documentation on "2.3 Commands" section.
|
|
|
|
|
2004-02-17 13:38:45 +00:00
|
|
|
2.1 How To Use Commands In Install Sections and Functions
|
|
|
|
---------------------------------------------------------
|
|
|
|
|
|
|
|
Every command used in install sections and functions have to be called
|
2004-04-09 13:17:55 +00:00
|
|
|
first before and out of any sections and functions, and without
|
|
|
|
parameters.
|
2004-02-17 13:38:45 +00:00
|
|
|
|
|
|
|
Example:
|
|
|
|
--------
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
!include "StrFunc.nsh"
|
|
|
|
|
|
|
|
${StrStr}
|
|
|
|
|
|
|
|
Section
|
|
|
|
|
|
|
|
${StrStr} $0 "OK! Now what?" "wh"
|
|
|
|
|
|
|
|
SectionEnd
|
2004-02-17 13:38:45 +00:00
|
|
|
|
|
|
|
2.2 How To Use Commands In Uninstall Sections and Functions
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
|
|
|
Commands with Uninstall Sections and Functions support have "Un" before
|
|
|
|
the words inside brackets "{}".
|
|
|
|
|
|
|
|
Example:
|
|
|
|
--------
|
|
|
|
|
|
|
|
${UnStrStr}
|
|
|
|
|
|
|
|
Every command used in uninstall sections and functions have to be called
|
|
|
|
first before and out any sections and functions, without parameters, and
|
2004-04-09 13:17:55 +00:00
|
|
|
after the header command "${UnStrFunc}" to activate the Uninstall
|
|
|
|
sections and functions support for the commands following.
|
2004-02-17 13:38:45 +00:00
|
|
|
|
|
|
|
Example:
|
|
|
|
--------
|
|
|
|
|
|
|
|
!include "StrFunc.nsh"
|
|
|
|
|
|
|
|
${StrStr} # Supportable for Install Sections and Functions
|
|
|
|
|
|
|
|
${UnStrFunc} # Command to separate commands supportable for
|
|
|
|
# Install/Uninstall sections and functions
|
|
|
|
|
|
|
|
${UnStrStr} # Supportable for Uninstall Sections and Functions
|
|
|
|
|
|
|
|
Section
|
|
|
|
|
|
|
|
${StrStr} $0 "OK! Now what?" "wh"
|
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Section Uninstall
|
|
|
|
|
|
|
|
${UnStrStr} $0 "OK! Now what?" "wh"
|
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
2.3 Commands
|
|
|
|
------------
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
=========================================================================
|
2004-04-09 13:17:55 +00:00
|
|
|
**** ${StrCase}
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
ResultVar String Type(Lower|Upper|Title|Sentence (Case))
|
2004-02-07 00:39:42 +00:00
|
|
|
=========================================================================
|
2004-04-09 13:17:55 +00:00
|
|
|
Converts "String" to "Type" Case.
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
ResultVar
|
|
|
|
Destination where result is returned.
|
|
|
|
|
|
|
|
String
|
2004-04-09 13:17:55 +00:00
|
|
|
String to convert to "Type" case.
|
|
|
|
|
|
|
|
Type
|
|
|
|
Type of string case to convert to:
|
|
|
|
|
|
|
|
- Lower Case (this is just an example. however this can be useful.)
|
|
|
|
- Upper Case (THIS IS JUST AN EXAMPLE. HOWEVER THIS CAN BE USEFUL.)
|
|
|
|
- Title Case (This Is Just An Example. However This Can Be Useful.)
|
|
|
|
- Sentence Case (This is just an example. However this can be
|
|
|
|
useful.)
|
|
|
|
|
|
|
|
Default value is "Setence Case".
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
Result Value -> ResultVar:
|
|
|
|
|
|
|
|
"String" in "Type" case.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
${StrCase} $0 "That's gonna hurt!" "Upper Case"
|
|
|
|
|
|
|
|
$0 = "THAT'S GONNA HURT!"
|
|
|
|
|
|
|
|
=========================================================================
|
|
|
|
**** ${StrClbSet}
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
String
|
|
|
|
=========================================================================
|
|
|
|
Copy "String" to clipboard.
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
String
|
|
|
|
String to put in the clipboard.
|
|
|
|
|
|
|
|
=========================================================================
|
|
|
|
**** ${StrClbGet}
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
ResultVar
|
|
|
|
=========================================================================
|
|
|
|
Get a string from the clipboard and return it to "ResultVar".
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
ResultVar
|
|
|
|
Destination where result is returned.
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
Result Value -> ResultVar:
|
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
The string found in clipboard.
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
=========================================================================
|
|
|
|
***** ${StrIOToNSIS}
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
ResultVar String
|
|
|
|
=========================================================================
|
|
|
|
Convert "String" from Install Options plugin to be supported by NSIS.
|
|
|
|
Escape, back-slash, carriage return, line feed and tab characters are
|
|
|
|
converted.
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
Parameters:
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
ResultVar
|
|
|
|
Destination where result is returned.
|
|
|
|
|
|
|
|
String
|
|
|
|
String to convert to be supportable for NSIS.
|
|
|
|
|
|
|
|
Result Value -> ResultVar:
|
|
|
|
|
|
|
|
"String" supportable for NSIS.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
${StrIOToNSIS} $0 "\r\n\t\\This is just an example\\"
|
|
|
|
|
|
|
|
$0 = "$\r$\n$\t\This is just an example\"
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
=========================================================================
|
2004-04-09 13:17:55 +00:00
|
|
|
** ${StrLoc}
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
ResultVar String StrToSearchFor OffsetDirection(>|<)
|
2004-02-07 00:39:42 +00:00
|
|
|
=========================================================================
|
|
|
|
Searches for "StrToSearchFor" in "String" and returns its location,
|
2004-02-07 15:47:54 +00:00
|
|
|
according to "OffsetDirection".
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
ResultVar
|
|
|
|
Destination where result is returned.
|
|
|
|
|
|
|
|
String
|
|
|
|
String where to search "StrToSearchFor".
|
|
|
|
|
|
|
|
StrToSearchFor
|
|
|
|
String to search in "String".
|
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
OffsetDirection(>|<)
|
2004-04-09 13:17:55 +00:00
|
|
|
Direction where the counter goes to. Default is ">".
|
|
|
|
(> = left to right, < = right to left)
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
Result Value -> ResultVar:
|
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
Where "StrToSearchFor" is, according to "OffsetDirection".
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
Example:
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
${StrLoc} $0 "This is just an example" "just" "<"
|
|
|
|
|
|
|
|
$0 = "11"
|
|
|
|
|
|
|
|
=========================================================================
|
2004-04-09 13:17:55 +00:00
|
|
|
***** ${StrNSISToIO}
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
ResultVar String
|
|
|
|
=========================================================================
|
|
|
|
Converts "String" from NSIS to be supported by Install Options plugin.
|
|
|
|
Escape, back-slash, carriage return, line feed and tab characters are
|
|
|
|
converted.
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
ResultVar
|
|
|
|
Destination where result is returned.
|
|
|
|
|
|
|
|
String
|
|
|
|
String to convert to be supportable for Install Options plugin.
|
|
|
|
|
|
|
|
Result Value -> ResultVar:
|
|
|
|
|
|
|
|
"String" supportable for Install Options plugin.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
${StrNSISToIO} $0 "$\r$\n$\t\This is just an example\"
|
|
|
|
|
|
|
|
$0 = "\r\n\t\\This is just an example\\"
|
|
|
|
|
|
|
|
=========================================================================
|
|
|
|
***** ${StrStr}
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
ResultVar String StrToSearchFor
|
|
|
|
=========================================================================
|
|
|
|
Searches for "StrToSearchFor" in "String".
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
ResultVar
|
|
|
|
Destination where result is returned.
|
|
|
|
|
|
|
|
String
|
|
|
|
String where to search "StrToSearchFor".
|
|
|
|
|
|
|
|
StrToSearchFor
|
|
|
|
String to search in "String".
|
|
|
|
|
|
|
|
Result Value -> ResultVar:
|
|
|
|
|
|
|
|
"StrToSearchFor" + the string after where it was found in "String".
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
${StrStr} $0 "This is just an example" "just"
|
|
|
|
|
|
|
|
$0 = "just an example"
|
|
|
|
|
|
|
|
=========================================================================
|
|
|
|
***** ${StrStrAdv}
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
ResultVar String StrToSearchFor SearchDirection(>|<)
|
|
|
|
ResultStrDirection(>|<) DisplayStrToSearch(1|0) Loops
|
2004-02-07 00:39:42 +00:00
|
|
|
=========================================================================
|
|
|
|
Searches for "StrToSearchFor" in "String" in the direction specified by
|
|
|
|
"SearchDirection" and looping "Loops" times.
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
ResultVar
|
|
|
|
Destination where result is returned.
|
|
|
|
|
|
|
|
String
|
|
|
|
String where to search "StrToSearchFor".
|
|
|
|
|
|
|
|
StrToSearchFor
|
|
|
|
String to search in "String".
|
|
|
|
|
|
|
|
SearchDirection (>|<)
|
|
|
|
Where do you want to direct the search. Default is ">" (to right).
|
|
|
|
(< = To left, > = To right)
|
|
|
|
|
|
|
|
ResultStrDirection (>|<)
|
2004-04-09 13:17:55 +00:00
|
|
|
Where the result string will be based on in relation of
|
|
|
|
"StrToSearchFor"
|
2004-02-07 15:47:54 +00:00
|
|
|
position. Default is ">" (to right). (< = To left, > = To right)
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
DisplayStrToSearch (1|0)
|
2004-04-09 13:17:55 +00:00
|
|
|
Display "StrToSearchFor" in the result. Default is "1" (True).
|
|
|
|
(1 = True, 0 = False)
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
Loops
|
|
|
|
Number of times the code will search "StrToSearchFor" in "String" not
|
|
|
|
including the original execution. Default is "0" (1 code execution).
|
|
|
|
|
|
|
|
|
|
|
|
Result Value -> ResultVar:
|
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
"StrToSearchFor" if "DisplayStrToSearch" is 1 + the result string after
|
|
|
|
or before "StrToSearchFor", depending on "ResultStrDirection".
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
Result with Errors:
|
|
|
|
|
|
|
|
When "StrToSearchFor" was not found, will return an empty string.
|
|
|
|
|
|
|
|
When you put nothing in "StrToSearchFor", will return "String" and set
|
|
|
|
error flag.
|
|
|
|
|
|
|
|
When you put nothing in "String", will return an empty string and set
|
|
|
|
error flag.
|
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
Example:
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
${StrStrAdv} $0 "This is just an example" "is" "<" "<" "1" "1"
|
|
|
|
|
|
|
|
$0 = "This"
|
|
|
|
|
|
|
|
=========================================================================
|
2004-04-09 13:17:55 +00:00
|
|
|
***** ${StrRep}
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
ResultVar String StrToReplace ReplacementString
|
2004-02-07 00:39:42 +00:00
|
|
|
=========================================================================
|
2004-02-07 15:47:54 +00:00
|
|
|
Searches for all "StrToReplaceFor" in "String" replacing those with
|
2004-02-07 00:39:42 +00:00
|
|
|
"ReplacementString".
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
ResultVar
|
|
|
|
Destination where result is returned.
|
|
|
|
|
|
|
|
String
|
2004-02-07 15:47:54 +00:00
|
|
|
String where to search "StrToReplaceFor".
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
StrToReplaceFor
|
|
|
|
String to search in "String".
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
StringToBeReplacedWith
|
2004-02-07 00:39:42 +00:00
|
|
|
String to replace "StringToReplace" when it is found in "String".
|
|
|
|
|
|
|
|
Result Value -> ResultVar:
|
|
|
|
|
|
|
|
"String" with all occurences of "StringToReplace" replaced with
|
|
|
|
"ReplacementString".
|
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
Example:
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
${StrRep} $0 "This is just an example" "an" "one"
|
|
|
|
|
|
|
|
$0 = "This is just one example"
|
|
|
|
|
|
|
|
=========================================================================
|
2004-04-09 13:17:55 +00:00
|
|
|
***** ${StrSort}
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
ResultVar String CenterStr LeftStr RightStr IncludeLeftRightStr(1|0)
|
|
|
|
IncludeCenterStr(1|0)
|
2004-02-07 15:47:54 +00:00
|
|
|
=========================================================================
|
|
|
|
Searches for "CenterStr" in "String", and returns only the value
|
|
|
|
between "LeftStr" and "RightStr", including or not the "CenterStr" using
|
|
|
|
"IncludeCenterStr" and/or the "LeftStr" and "RightStr" using
|
|
|
|
"IncludeLeftRightStr".
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
ResultVar
|
|
|
|
Destination where result is returned.
|
|
|
|
|
|
|
|
String
|
|
|
|
String where to search "CenterStr".
|
|
|
|
|
|
|
|
CenterStr
|
|
|
|
String to search in "String".
|
|
|
|
|
|
|
|
LeftStr
|
|
|
|
The first occurrence of "LeftStr" on the left of "CenterStr".
|
|
|
|
If it is an empty value, or was not found, will return
|
|
|
|
everything on the left of "CenterStr".
|
|
|
|
|
|
|
|
RightStr
|
|
|
|
The first occurrence of "RightStr" on the right of "CenterStr".
|
|
|
|
If it is an empty value, or was not found, will return
|
|
|
|
everything on the right of "CenterStr".
|
|
|
|
|
|
|
|
IncludeLeftRightStr(1|0)
|
|
|
|
Include or not the "LeftStr" and "RightStr" in the result value.
|
|
|
|
Default is 1 (True). (1 = True, 0 = False)
|
|
|
|
|
|
|
|
IncludeCenterStr(1|0)
|
|
|
|
Include or not the "CenterStr" in the result value. Default is 1
|
|
|
|
(True). (1 = True, 0 = False)
|
|
|
|
|
|
|
|
Result Value -> ResultVar:
|
|
|
|
|
|
|
|
String between "LeftStr" and "RightStr" of a found "CenterStr"
|
|
|
|
including or not the "LeftStr" and "RightStr" if
|
|
|
|
"IncludeLeftRightStr" is 1 and/or the "CenterStr" if
|
|
|
|
"IncludeCenterStr" is 1.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
${StrSort} $0 "This is just an example" " just" "" "ple" "0" "0"
|
|
|
|
|
|
|
|
$0 = "This is an exam"
|
|
|
|
|
2004-02-07 00:39:42 +00:00
|
|
|
=========================================================================
|
2004-04-09 13:17:55 +00:00
|
|
|
***** ${StrTok}
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
ResultVar StrToTokenize Separators ResultPart SkipEmptyParts(1|0)
|
2004-02-07 00:39:42 +00:00
|
|
|
=========================================================================
|
2004-04-09 13:17:55 +00:00
|
|
|
Returns the part "ResultPart" between two "Separators" inside
|
|
|
|
"StrToTokenize".
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
ResultVar
|
|
|
|
Destination where result is returned.
|
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
StrToTokenize
|
|
|
|
String where to search for "Separators".
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
Separators
|
|
|
|
Characters to find in "StrToTokenize".
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
ResultPart
|
|
|
|
The part want to be found in "StrToTokenize" between two "Separators".
|
|
|
|
Can be any number, starting at 1, and "L" that is the last part.
|
|
|
|
Default is L.
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
SkipEmptyParts(1|0)
|
|
|
|
Skips empty string parts between two "Separators". Default is 1 (True).
|
|
|
|
(1 = True, 0 = False)
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
Result Value -> ResultVar:
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
"StrToTokenize" part "Part" between two "Separators".
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
Examples:
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
1) ${StrTok} $0 "This is, or is not, just an example" " ," "5" "1"
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
$0 = "not"
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
2) ${StrTok} $0 "This is, or is not, just an example" " ," "5" "0"
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
$0 = "is"
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
=========================================================================
|
2004-04-09 13:17:55 +00:00
|
|
|
* ${StrTrimNewLines}
|
|
|
|
-------------------------------------------------------------------------
|
|
|
|
ResultVar String
|
2004-02-07 00:39:42 +00:00
|
|
|
=========================================================================
|
2004-04-09 13:17:55 +00:00
|
|
|
Deletes unnecessary new lines at end of "String".
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
ResultVar
|
|
|
|
Destination where result is returned.
|
|
|
|
|
|
|
|
String
|
2004-04-09 13:17:55 +00:00
|
|
|
String where to search unnecessary new lines at end of "String".
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
Result Value -> ResultVar:
|
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
"String" with unnecessary end new lines removed.
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
Example:
|
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
${StrTrimNewLines} $0 "$\r$\nThis is just an example$\r$\n$\r$\n"
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
$0 = "$\r$\nThis is just an example"
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
Comments about functions included and not included
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
12 functions have been included
|
|
|
|
6 were included as are in Archive
|
|
|
|
6 were not included in Archive
|
|
|
|
StrTok (AdvStrTok)
|
|
|
|
StrLoc
|
|
|
|
StrSort (AdvStrSort)
|
|
|
|
StrCase
|
2004-02-07 00:39:42 +00:00
|
|
|
NSISToIO
|
|
|
|
IOToNSIS
|
|
|
|
|
2004-06-25 20:00:50 +00:00
|
|
|
13 functions have not been included
|
2004-04-09 13:17:55 +00:00
|
|
|
10 were not included because of better functions
|
2004-02-07 15:47:54 +00:00
|
|
|
6 were not included because of AdvStrTok (called here as StrTok)
|
2004-02-07 00:39:42 +00:00
|
|
|
First String Part Function
|
|
|
|
Save on Variables Function
|
2004-02-07 15:47:54 +00:00
|
|
|
Sort Strings (1, 2 and 3) Functions
|
2004-02-07 00:39:42 +00:00
|
|
|
StrTok Function
|
2004-04-09 13:17:55 +00:00
|
|
|
2 were not included because of StrCase
|
|
|
|
StrLower Function
|
|
|
|
StrUpper Function
|
2004-02-07 00:39:42 +00:00
|
|
|
1 was not included because of NSISToIO and IOToNSIS
|
|
|
|
Convert / to // in Paths Function
|
|
|
|
1 was not included because of original String Replace Function (called
|
|
|
|
here as StrRep)
|
|
|
|
Another String Replace Function
|
2004-02-07 15:47:54 +00:00
|
|
|
2 were not included because isn't useful anymore
|
2004-02-07 00:39:42 +00:00
|
|
|
Slash <-> Backslash Converter Function
|
|
|
|
Trim Function
|
|
|
|
1 was not included because of bugs
|
|
|
|
Number to String Converter Function
|
|
|
|
|
|
|
|
Comments
|
|
|
|
------------------------------------------------------------
|
|
|
|
|
|
|
|
Advanced Token String Function
|
|
|
|
|
|
|
|
New function not published in Archive, much better than original StrTok,
|
|
|
|
going to replace several functions with just one. The principal idea was
|
|
|
|
based on "Save On Variables" by Afrow UK.
|
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
Advanced String Sort Function
|
|
|
|
|
|
|
|
New function not published in Archive, much better than original StrSort.
|
|
|
|
|
2004-02-07 00:39:42 +00:00
|
|
|
Another String Replace Function
|
|
|
|
|
|
|
|
Another doesn't mean better and simpler than the original version.
|
|
|
|
(Don't confuse the original StrRep that is in this header file with this
|
|
|
|
one)
|
|
|
|
|
|
|
|
Convert / to // in Paths Function
|
|
|
|
|
|
|
|
StrNSISToIO and StrIOToNSIS are better.
|
|
|
|
|
|
|
|
First String Part Function
|
|
|
|
|
|
|
|
AdvStrTok (called here as StrTok) is better.
|
|
|
|
|
|
|
|
NSIS <-> Install Options String Convertor Functions
|
|
|
|
|
|
|
|
Included from Install Options Readme.
|
|
|
|
|
|
|
|
Number to String Converter Function
|
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
A buggy one, needs to be remade.
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
Save on Variables Function
|
|
|
|
|
|
|
|
AdvStrTok (called here as StrTok) is better.
|
|
|
|
|
|
|
|
Slash <-> Backslash Converter Function
|
|
|
|
|
|
|
|
Will convert "http://www.site.com\" to "http:\\www.site.com/", not
|
|
|
|
really useful for anyone.
|
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
Sort Strings (1, 2 and 3) Functions
|
|
|
|
|
|
|
|
AdvStrTok (called here as StrTok), AdvStrStr (called here as StrStrAdv)
|
|
|
|
and AdvStrSort (called here as StrSort) are better.
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
Split String Function
|
|
|
|
|
|
|
|
AdvStrTok (called here as StrTok) is better.
|
|
|
|
|
|
|
|
StrTok Function
|
|
|
|
|
|
|
|
AdvStrTok (called here as StrTok) is better.
|
|
|
|
|
|
|
|
Trim Function
|
|
|
|
|
|
|
|
The real purpose of this function was to remove spaces from directory
|
|
|
|
paths, and now with the NSIS command GetFullPathName this is not useful
|
|
|
|
anymore.
|
|
|
|
|
|
|
|
Version History
|
|
|
|
---------------
|
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
1.06 - 03/26/2004
|
|
|
|
|
2004-06-25 20:00:50 +00:00
|
|
|
- StrNumToStr removed due to complex number handling on some languages.
|
2004-04-09 13:17:55 +00:00
|
|
|
- Fixed the bug where the old string was attached to string returned by
|
2004-06-25 20:00:50 +00:00
|
|
|
StrCase when $R5 variable was used.
|
2004-04-09 13:17:55 +00:00
|
|
|
|
|
|
|
1.05 - 03/17/2004
|
|
|
|
|
|
|
|
- Fixed a bug with StrCase, Title Case wasn't working as should be.
|
|
|
|
- Fixed a bug with StrStrAdv, previous fix created another bug, string not
|
|
|
|
returned correctly when using backwards search with "DisplayStrToSearch" as
|
|
|
|
"0".
|
|
|
|
|
|
|
|
1.04 - 03/07/2004
|
|
|
|
|
|
|
|
- Added new StrCase, removed StrLower and StrUpper.
|
|
|
|
- Organized by name commands inside header and readme files.
|
|
|
|
|
2004-02-17 13:38:45 +00:00
|
|
|
1.03 - 02/12/2004
|
|
|
|
|
|
|
|
- Added commands support for uninstall sections and functions.
|
|
|
|
- Fixed variables switch in "StrLoc" and "StrTok" after using these.
|
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
1.02 - 02/07/2004
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
- Fixed StrLoc.
|
2004-04-09 13:17:55 +00:00
|
|
|
- Fixed Documentation about StrLoc. "Direction" is really "OffsetDirection".
|
2004-02-07 15:47:54 +00:00
|
|
|
- Added my new AdvStrSort, and removed the old one.
|
2004-02-07 00:39:42 +00:00
|
|
|
|
2004-02-07 15:47:54 +00:00
|
|
|
1.01 - 02/05/2004
|
2004-02-07 00:39:42 +00:00
|
|
|
|
|
|
|
- Fixed Documentation about StrSort and StrTok.
|
|
|
|
- Fixed StrTok default value for the string part. Now it's "L".
|
|
|
|
- Fixed StrStrAdv fixed wrong search when had a combination of same
|
2004-04-09 13:17:55 +00:00
|
|
|
substrings one after another in a string.
|
2004-02-07 00:39:42 +00:00
|
|
|
- Fixed StrLoc, when a string isn't found, don't return any value at all.
|
|
|
|
|
|
|
|
1.00 - 02/01/2004
|
|
|
|
|
|
|
|
- Added documentation.
|
|
|
|
- Renamed header file to "StrFunc.nsh".
|
|
|
|
- Added 1 function, StrLoc.
|
|
|
|
- Modified StrStrAdv, removed some lines.
|
2004-02-07 15:47:54 +00:00
|
|
|
- Fixed StrTok, 2 simple numbers made it loop every time.
|
2004-02-07 00:39:42 +00:00
|
|
|
- Fixed some small issues in the header file.
|
|
|
|
|
|
|
|
0.02 - 01/24/2004
|
|
|
|
|
|
|
|
- Completed StrFunc.nsh file. Need some tests and the readme.
|
|
|
|
|
|
|
|
0.01 - 01/22/2004
|
|
|
|
|
|
|
|
- First version to test ideas...
|
|
|
|
|
|
|
|
Credits
|
|
|
|
-------
|
|
|
|
|
|
|
|
Made by Diego Pedroso (aka deguix).
|
|
|
|
|
|
|
|
Functions Credits
|
|
|
|
-----------------
|
|
|
|
|
2004-04-09 13:17:55 +00:00
|
|
|
- Advanced Search in String, Advanced Token String, Localize in String,
|
2004-06-25 20:00:50 +00:00
|
|
|
String Case, Advanced Sort String, made by Diego Pedroso.
|
2004-02-07 00:39:42 +00:00
|
|
|
- Copy to/from clipboard made by Nik Medved.
|
|
|
|
- StrReplace made by Hendri Adriaens.
|
|
|
|
- Search in a string, Trim newlines made by Ximon Eighteen.
|
|
|
|
- NSISToIO and IOToNSIS made by Amir Szekely, Joost Verburg and Dave Laundon.
|
|
|
|
|
|
|
|
License
|
|
|
|
-------
|
|
|
|
|
|
|
|
This header file is provided 'as-is', without any express or implied
|
|
|
|
warranty. In no event will the author be held liable for any damages
|
|
|
|
arising from the use of this header file.
|
|
|
|
|
|
|
|
Permission is granted to anyone to use this header file for any purpose,
|
|
|
|
including commercial applications, and to alter it and redistribute
|
|
|
|
it freely, subject to the following restrictions:
|
|
|
|
|
|
|
|
1. The origin of this header file must not be misrepresented;
|
|
|
|
you must not claim that you wrote the original header file.
|
|
|
|
If you use this header file in a product, an acknowledgment in the
|
|
|
|
product documentation would be appreciated but is not required.
|
|
|
|
2. Altered versions must be plainly marked as such,
|
|
|
|
and must not be misrepresented as being the original header file.
|
2004-02-17 13:38:45 +00:00
|
|
|
3. This notice may not be removed or altered from any distribution.
|