Jump to content
RaiNote

Just A Problem don't know how to name it^^

Recommended Posts

Well Hello,

I currently a bit sad because i can't find anywhere in helpfiles and google away in autoit to check if a number between another number is the same as 4 variables which is checking if the main variable got the same princip of looking >.<.( I really can't explain it at all)

Case $Send2Box
            $ReadText2Box = GuictrlRead($Text2Box)
            _GUICtrlEdit_AppendText($Console, $ReadText2Box & @CRLF)
            If $ReadText2Box = '/ping ' & $ip1 & '.' & $ip2 & '.' & $ip3 & '.' & $ip4 Then
                $IP = StringRight('/ping ', 1)
                $Ping = Ping($IP)
                _GUICtrlEdit_AppendText($Console,'Ping is: ' & $Ping & 'ms')
                GUICtrlSetData($Text2Box,'')
            EndIf

Next try to explain ^-^ i want to check if the text in the inputbox($Text2Box which is read from $ReadText2Box) the same looking like a ip but with a '/ping ' before and i don't know how to make the variables to check this.. and getting after it checked that it is truly a IP to ping it and send it to $Console to display the ms

I hope i could explained it anyway to understand it(if i write more i am getting more confused)

Thanks to everyone who try's to help me :D


  • C++/AutoIt/OpenGL Easy Coder
  • I will be Kind to you and try to help you
  • till what you want isn't against the Forum
  • Rules~

 

Share this post


Link to post
Share on other sites

This looks like you are pinging the letter g which is what StringRight('/ping',1) will return.

$IP = StringRight('/ping ', 1)
                $Ping = Ping($IP)

I think you want to to ping:

$ip1 & '.' & $ip2 & '.' & $ip3 & '.' & $ip4

From what I can tell maybe the issue is that you are reading an IP address from the textbox that starts with "/ping".  If you want to remove that you could just trim it off from $ReadTextBox2.  StringTrimLeft is how you could chop off those characters. $IP=StringTrimLeft($ReadTextBox2,5).  That is all a guess based on what I think I read in your post.

Share this post


Link to post
Share on other sites

The StringRight call as you have it there just returns the rightmost character of "/ping ", which is a space.

Change

$IP = StringRight('/ping ', 1)

to

$IP = StringTrimLeft($ReadText2Box, 6)

It will trim 6 characters from the $RestText2Box, exactly the length of string "/ping ", and return the result, which should be your IP address.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

What's in your $ip1, $ip2...? Judging from your current code it looks like you are checking whether it is a specific IP-address, defined in your $ip1 etc.. If you mean you want to check if the thing after "/ping " ($IP) is a string in the format of "<0-255>.<0-255>.<0-255>.<0-255>", you can take multiple approaches. One is to write a function to split $IP into parts using "." as a delimiter, then checking whether you get 4 results, each being a number between 0 and 255. Like so:

ConsoleWrite(_isIpAddress("abc") & @CRLF)
ConsoleWrite(_isIpAddress("12.34.56.78.90") & @CRLF)
ConsoleWrite(_isIpAddress("999.999.999.999") & @CRLF)
ConsoleWrite(_isIpAddress("127.0.0.1") & @CRLF)

Func _isIpAddress($IP)

    $splitResult = StringSplit($IP, ".")

    If $splitResult[0] <> 4 Then Return False
    For $supposedNumber In $splitResult
        If $supposedNumber < 0 Or $supposedNumber > 255 Then Return False
    Next
    Return True
EndFunc   ;==>_isIpAddress

 


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

Hello,

I got a problem with my Code. Only GUI code works out but when i use with all my Functions the Gui goes down to the endless >.<

Code:

;*****************************************
;CraTool.au3 by RaiNote
;Erstellt mit ISN AutoIt Studio v. 0.98 BETA
;*****************************************


;Includes
#include <GUIConstantsEx.au3>
#include <GuiEdit.au3>
#include <String.au3>
#include "Forms\CraTool.isf"
#include "Functions.au3" 
#include <Inet.au3>
#include <_UskinDLL.au3>
#include <_UskinLibrary.au3>
#include <Skins\Descent.au3>
;Includes

_Uskin_LoadDLL()
_USkin_Init(_Descent(True))

;Variablen


GUISetState(@SW_SHOW, $CraTool)

While 1
    
    $nMsg = GUIGetMsg()
    Switch $nMsg
        
        Case $GUI_EVENT_CLOSE
            Exit
            
        Case $Send2Box
            
            ;Some Main needs for Commands
            $ReadText2Box = GuictrlRead($Text2Box)
            $IP = StringTrimLeft($ReadText2Box, 6)
            $IsIP = _isIpAddress($IP)
            $IP2 = StringTrimLeft($ReadText2Box, 4)
            $IsDomain = _isIpAddress($IP)
            $CheckCom4Digits = StringLeft($ReadText2Box,5)
            $CheckCom2Digits = StringLeft($ReadText2Box,3)
            _GUICtrlEdit_AppendText($Console, $ReadText2Box & @CRLF)
            ;
            
            If $CheckCom4Digits = '/ping' Then
                
                If $IsIP = 1 Then
                $Ping = Ping($IP)
                _GUICtrlEdit_AppendText($Console,'Ping is: ' & $Ping & 'ms' & @CRLF)
                
                ElseIf $IsIP = 0 Then
                    $PingDom = Ping($IP)
                    
                    If $PingDom > 0 Then
                    _GUICtrlEdit_AppendText($Console,'Ping is: ' & $PingDom & 'ms' & @CRLF)
                    
                    Else
                    _GUICtrlEdit_AppendText($Console,$IP & " isn't a valid IP" & @CRLF)
                    EndIf
                    
                EndIf
                
            EndIf
            
            If $CheckCom2Digits = '/ip' Then
                
                If $IsDomain = 0 Then
                    $IpGet = TCPNameToIP($IP2)
                _GUICtrlEdit_AppendText($Console,'IP is: ' & $IpGet & @CRLF)
                    
                ElseIf $IsDomain = 1 Then
                    $DomainGet = _TCPIpToName($IP2)
                    _GUICtrlEdit_AppendText($Console,$IP2 & ' is already an IP' &  @CRLF)
                    _GUICtrlEdit_AppendText($Console,$DomainGet & @CRLF & '->Domain of ' & $IP2 & @CRLF)
                EndIf
                
            EndIf
            GUICtrlSetData($Text2Box,'')
        Case $LoupCom
            _GUICtrlEdit_AppendText($Console, 'IIIIIIIIIIIIIIIIIIIIIIIIIIIIII' & @CRLF & 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv' & @CRLF & 'Command: Ping' & @CRLF & 'Usage-> /ping Ip or Domain' & @CRLF & 'Info-> It shows the time it takes to connect from your Computer to another.' & @CRLF)
            
    EndSwitch

WEnd

GUI:

#include-once

; -- Created with ISN Form Studio 2 for ISN AutoIt Studio -- ;
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>
#include <EditConstants.au3>
#Include <GuiMenu.au3>

$CraTool = GUICreate("CraTool",618,386,-1,-1,-1,-1)
$MenuItem681 = GUICtrlCreateMenu("Plugins")
$PluginsEnableMenu = GUICtrlCreateMenuItem("Enable",$MenuItem681,-1,1)
$PluginsDisableMenu = GUICtrlCreateMenuItem("Disable",$MenuItem681,-1,1)
$Send2Box = GUICtrlCreateButton("Send",413,323,60,19,-1,-1)
$Console = GUICtrlCreateEdit("",413,0,198,303,2244,-1)
GUICtrlSetFont(-1,8,400,0,"Lucida Console")
GUICtrlSetColor(-1,"0x0000A0")
GUICtrlSetBkColor(-1,"0x00FF80")
$Text2Box = GUICtrlCreateInput("Text to Box",413,303,194,20,192,512)
$LoupCom = GUICtrlCreateButton("Lookup Commands",473,323,100,19,-1,-1)
GUISetState(@SW_SHOW,$CraTool)

Functions:

;Functions.au3

Func _isIpAddress($IP)

    $splitResult = StringSplit($IP, ".")

    If $splitResult[0] <> 4 Then Return False
    For $supposedNumber In $splitResult
        If $supposedNumber < 0 Or $supposedNumber > 255 Then Return False
    Next
    Return True
EndFunc   ;==>_isIpAddress

That's all i can provide as code but i really don't get where the problem is. Maybe it's my Laptop because before on my computer it worked fine everything. ^^

I hope someone could help me :3

Thanks to everyone ^-^

Edit: Wups wrong section just saw it right now sorry If someone could move would be nice^^

Edited by RaiNote
Wrong Section

  • C++/AutoIt/OpenGL Easy Coder
  • I will be Kind to you and try to help you
  • till what you want isn't against the Forum
  • Rules~

 

Share this post


Link to post
Share on other sites

Are you trying to look at a string and see if it is formatted as an IP address?  xxx.xxx.xxx.xxx?  If so, have a look at StringRegExp to test for a pattern.  If that is not what you are after maybe you could post in your native language as something may be getting lost in translation (or use Google translate to explain).

Share this post


Link to post
Share on other sites

complete Code and i know wrong section but i saw it to late e.e

????  Not really sure what that means.  Is this the same issue you posted here with code?: https://www.autoitscript.com/forum/topic/173874-gui-problem/

 

Share this post


Link to post
Share on other sites

@RaiNote, Threads are merged and hope you will stick to one single thread for the same question from here on.

Believe this is "strike two" today.

Jos

Share this post


Link to post
Share on other sites

@RaiNote:  you are posting snippets of your code - that would very hard (at least for me - maybe others have a better opinion) to test and figure out the problem.  If you don't want to post the entire code can you create a simple "reproducer" script that shows the exact issue with working code?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By Inpho
      Hi All,
      I intend on keeping custom functions/UDFs (works in progress) here; if anyone wants to use any code, feel free.
      String functions:
      #AutoIt3Wrapper_AU3Check_Parameters=-d -w- 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include-once ; #FUNCTION# ==================================================================================================================== ; Name ..........: _DateTimeGet ; Description ...: Returns the date and time formatted for use in sortable filenames, logs, listviews, etc. ; Syntax ........: _DateTimeGet(iType = 1[, $bHumanFormat = False]) ; Parameters ....: $iType - [optional] an integer value. Default is 1. ; 1 - Date and time in file-friendly format; 20190115_113756 ; 2 - Date in file-friendly format; 20190115 ; 3 - Time in file friendly format; 113756 ; $bHumanFormat - [optional] a boolean value. Default is False. ; True - Includes slashes in the date and colons in the time with a space inbetween ; False - No slashes or colons included with an underscore inbetween ; Return values .: Success - String ; Failure - Sets @error to non-zero and returns an empty string ; Author ........: Sam Coates ; =============================================================================================================================== Func _DateTimeGet($iType = 1, $bHumanFormat = False) If $iType < 1 Or $iType > 3 Then Return (SetError(-1, 0, "")) ;; Param1: ;; 1 = Date and time in file friendly format: 20190115_113756 ;; 2 = Date in file friendly format: 20190115 ;; 3 = Time in file friendly format: 113756 ;; Param2: ;; True = Use human-readable format: 15/01/2019 11:37:56 Local $sTime = @HOUR & ":" & @MIN & ":" & @SEC Local $sDate = @MDAY & "/" & @MON & "/" & @YEAR If $iType = 1 Then If $bHumanFormat = False Then $sTime = StringReplace($sTime, ":", "") $sDate = StringReplace($sDate, "/", "") $sDate = StringTrimLeft($sDate, 4) & StringMid($sDate, 3, 2) & StringLeft($sDate, 2) Return ($sDate & "_" & $sTime) Else Return ($sDate & " " & $sTime) EndIf ElseIf $iType = 2 Then If $bHumanFormat = False Then $sDate = StringReplace($sDate, "/", "") $sDate = StringTrimLeft($sDate, 4) & StringMid($sDate, 3, 2) & StringLeft($sDate, 2) EndIf Return ($sDate) ElseIf $iType = 3 Then If $bHumanFormat = False Then $sTime = StringReplace($sTime, "/", "") EndIf Return ($sTime) EndIf EndFunc ;==>_DateTimeGet ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FileToFileExtension ; Description ...: Returns a file extension from a filename/FQPN (Fully Qualified Path Name) ; Syntax ........: _FileToFileExtension($sPath) ; Parameters ....: $sPath - a string value. ; Return values .: Success - String ; Failure - Empty string as returned from StringTrimLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _FileToFileExtension($sPath) Return (StringTrimLeft($sPath, StringInStr($sPath, ".", 0, -1))) EndFunc ;==>_FileToFileExtension ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FileToFileName ; Description ...: Returns a filename from a FQPN (Fully Qualified Path Name) ; Syntax ........: _FileToFileName($sPath[, $bIncludeExtension = True]) ; Parameters ....: $sPath - a string value. ; $bIncludeExtension - [optional] a boolean value. Default is True. ; Return values .: Success - String ; Failure - Empty string as returned from StringLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _FileToFileName($sPath, $bIncludeExtension = True) Local $sReturn = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1)) If $bIncludeExtension = False Then $sReturn = StringLeft($sReturn, StringInStr($sReturn, ".", 0, -1) - 1) Return ($sReturn) EndFunc ;==>_FileToFileName ; #FUNCTION# ==================================================================================================================== ; Name ..........: _FileToFilePath ; Description ...: Returns a folder path from a FQPN (Fully Qualified Path Name) ; Syntax ........: _FileToFilePath($sPath) ; Parameters ....: $sPath - a string value. ; Return values .: Success - String ; Failure - Empty string as returned from StringLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _FileToFilePath($sPath) Return (StringLeft($sPath, StringInStr($sPath, "\", 0, -1) - 1)) EndFunc ;==>_FileToFilePath ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringLeft ; Description ...: Searches for a string inside a string, then removes everything on the right of that string ; Syntax ........: _StringLeft($sString, $sRemove[, $iCaseSense = 0, $iOccurrence = 1]) ; Parameters ....: $sString - a string value. The string to search inside. ; $sRemove - a string value. The string to search for. ; $iCaseSense - an integer value. Flag to indicate if the operations should be case sensitive. ; $iOccurrence - an integer value. Which occurrence of the substring to find in the string. Use a ; negative occurrence to search from the right side. ; Return values .: Success - String ; Failure - Empty string as returned from StringLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _StringLeft($sString, $sRemove, $iCaseSense = 0, $iOccurrence = 1) Return (StringLeft($sString, StringInStr($sString, $sRemove, $iCaseSense, $iOccurrence) - 1)) EndFunc ;==>_StringLeft ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringRandom ; Description ...: Returns a string of random characters ; Syntax ........: _StringRandom($iAmount[, $iType = 1]) ; Parameters ....: $iAmount - an integer value. Length of returned string ; $iType - [optional] an integer value. Default is 1. ; 1 - Return digits (0-9) ; 2 - Return hexadecimal (0-9, A - F) ; 3 - Return Alphanumeric upper (0-9, A - Z) ; 4 - Return Alphanumeric (0-9, A - Z, a - z) ; 5 - Return Alpha upper (A - Z) ; 6 - Return Alpha (A - Z, a - z) ; Return values .: Success - String ; Failure - Empty string and @error flag as follows: ; @error : 1 - $iAmount is not a positive integer ; 2 - $iType is out of bounds ; Author ........: Sam Coates ; =============================================================================================================================== Func _StringRandom($iAmount, $iType = 1) If $iAmount < 1 Or IsInt($iAmount) = 0 Then Return (SetError(-1, 0, "")) Local $sString = "" Local $iRandomLow = 1, $iRandomHigh = 62 #Tidy_Off Local Static $aCharId[63] = [0, Chr(48), Chr(49), Chr(50), Chr(51), Chr(52), Chr(53), Chr(54), Chr(55), Chr(56), Chr(57), Chr(65), Chr(66), Chr(67), _ Chr(68), Chr(69), Chr(70), Chr(71), Chr(72), Chr(73), Chr(74), Chr(75), Chr(76), Chr(77), Chr(78), Chr(79), Chr(80), _ Chr(81), Chr(82), Chr(83), Chr(84), Chr(85), Chr(86), Chr(87), Chr(88), Chr(89), Chr(90), Chr(97), Chr(98), Chr(99), _ Chr(100), Chr(101), Chr(102), Chr(103), Chr(104), Chr(105), Chr(106), Chr(107), Chr(108), Chr(109), Chr(110), Chr(111), _ Chr(112), Chr(113), Chr(114), Chr(115), Chr(116), Chr(117), Chr(118), Chr(119), Chr(120), Chr(121), Chr(122)] #Tidy_On If $iType = 1 Then ;; digits: 1 - 10 $iRandomHigh = 10 ElseIf $iType = 2 Then ;; hexadecimal: 1 - 16 $iRandomHigh = 16 ElseIf $iType = 3 Then ;; alnumupper: 1 - 36 $iRandomHigh = 36 ElseIf $iType = 4 Then ;; alnum: 1 - 62 $iRandomHigh = 62 ElseIf $iType = 5 Then ;; alphaupper: 11 - 36 $iRandomLow = 11 $iRandomHigh = 36 ElseIf $iType = 6 Then ;; alpha: 11 = 62 $iRandomLow = 11 $iRandomHigh = 62 Else Return (SetError(-2, 0, "")) EndIf For $i = 1 To $iAmount $sString &= $aCharId[Random($iRandomLow, $iRandomHigh, 1)] ;; append string with corresponding random character from ascii array Next Return ($sString) EndFunc ;==>_StringRandom ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringTrimLeft ; Description ...: Searches for a string inside a string, then removes everything on the left of that string ; Syntax ........: _StringTrimLeft($sString, $sRemove[, $iCaseSense = 0, $iOccurrence = 1]) ; Parameters ....: $sString - a string value. The string to search inside. ; $sRemove - a string value. The string to search for. ; $iCaseSense - an integer value. Flag to indicate if the operations should be case sensitive. ; $iOccurrence - an integer value. Which occurrence of the substring to find in the string. Use a ; negative occurrence to search from the right side. ; Return values .: Success - String ; Failure - Empty string as returned from StringTrimLeft() ; Author ........: Sam Coates ; =============================================================================================================================== Func _StringTrimLeft($sString, $sRemove, $iCaseSense = 0, $iOccurrence = 1) Return (StringTrimLeft($sString, StringInStr($sString, $sRemove, $iCaseSense, $iOccurrence) + StringLen($sRemove) - 1)) EndFunc ;==>_StringTrimLeft Examples:
      ConsoleWrite(_StringRandom(100, 6) & @CRLF) ConsoleWrite(_StringTrimLeft("C:\Windows\System32\cmd.exe", "C:\Windows\System32\") & @CRLF) ConsoleWrite(_StringLeft("C:\Windows\System32\cmd.exe", "cmd.exe") & @CRLF) ConsoleWrite(_FileToFileName("C:\Windows\System32\cmd.exe") & @CRLF) ConsoleWrite(_FileToFilePath("C:\Windows\System32\cmd.exe") & @CRLF) ConsoleWrite(_FileToFileExtension("C:\Windows\System32\cmd.exe") & @CRLF) ConsoleWrite(_StringRandom(6, 4) & "-" & _StringRandom(4, 4) & "-" & _StringRandom(4, 4) & "-" & _StringRandom(4, 4) & "-" & _StringRandom(6, 4)& @CRLF)  
    • By nacerbaaziz
      good morning sirs.
      please i have a request from you.
      i have an variable to Read a data from a file
      this data is Encrypted
      and when i read it i Decrypte it.
      for that i need a function to Write a ini data to string.
      ;#Function# ===================================================================================================================== ; Name............: _IniReadFromString ; Description.....: Returns the value of a key in a specific section of an ini-formatted string ; Syntax..........: _IniReadFromString($szInput, $szSection, $szKey, $Default) ; Parameters......: ;   $szInput - The string that contains data in ini format ;   $szSection   - The sectionname (just as in IniRead) ;   $szKey   - The keyname (just as in IniRead) ;   $Default - The default value if the key does not exist or reading failed (just as in IniRead) ; Return values ..: ;   Success  - Returns the read value ;   Failure  - Returns $Default ; Author .........: FichteFoll ; Remarks ........: Works for Unicode as well as for ANSI ; Related ........: IniRead, _IniReadSectionFromString ; Link ...........; See on top ; Example ........; $var = _IniReadFromString(StringFormat("[Sect]\r\nMyKey1=value1\r\nMyKey2=value2"), "Sect", "MyKey2", "no_value") ; =============================================================================================================================== Func _IniReadFromString($szInput, $szSection, $szKey, $Default) $szInput = StringStripCR($szInput) ;~  Local $aRegMl = StringRegExp($szInput, "\[" & __StringEscapeRegExp($szSection) & "\]\n+(?:[^\[].*?=.*\n)*" & __StringEscapeRegExp($szKey) & "=(.*)\n?(",3) Local $aRegMl = StringRegExp($szInput, "\[" & __StringEscapeRegExp($szSection) & "\]\n+(?:[^\[].*?=.*\n)*" & __StringEscapeRegExp($szKey) & "=(.*)\n?", 3) If @error Then Return SetError(1, 0, $Default) ; key not found    Return $aRegMl[0] EndFunc;==>_IniReadFromString ; ############################################################################################################################### ; =============================================== ; = Internal Use Only ; =============================================== Func __StringEscapeRegExp($szExp) Return StringRegExpReplace($szExp, "([\(\)\[\]\{\}\\\/\?\.\\|\+])", "\\$1") ; ()[]{}\/?.|+ EndFunc;==>__StringEscapeRegExp like this  function Read the ini from string.
       
       
      please ihelp me
      thanks in advance
    • By nacerbaaziz
      hello sirs,
      i have searched allot about an function that can  read the INI file as a  string
      i mean function to read the ini files from string and not from the file directly.
      i finally found an UDF that do what i want
      but unfortunately all the functions work,  but the function that i want it not working.
      this is the udf
      the function that  i need is _IniReadFromString
      this is the function

      Func _IniReadFromString($szInput, $szSection, $szKey, $Default) $szInput = StringStripCR($szInput) Local $aRegMl = StringRegExp($szInput, "\[" & __StringEscapeRegExp($szSection) & "\]\n+(?:[^\[].*?=.*\n)*" & __StringEscapeRegExp($szKey) & "=(.*)\n?(", 3) If @error Then Return SetError(1, 0, $Default) ; key not found Return $aRegMl[0] EndFunc;==>_IniReadFromString
      i hope that any one can help me
      thank you in advance
      iniex.au3
    • By careca
      This is another take on string triggers, triggers on specific strings.
      Able to simple text pasting,
      opening links (as long as there's a www. http:\\ or https:\\ at the beggining)
      and is able to open applications, if there is a parameter in the parameter field, it uses it.
      The user selects the modifier key, and then uses a combination of that key with a couple others to perform tasks like
      screenshot the active window, (modkey + prtscr), turn off the screen (modkey + pause / break),
      open clipboard string in registry (modkey + R), change system volume (modkey + arrouw up/dn).
      The following keys pressed at the same time prompt for shutdown: S+D+T
      The following keys pressed at the same time prompt for restart: S+R+T
      Middle mouse button click on titlebar minimizes to tray, or a left mouse button click in the icon in the tray also minimizes.
      Trigger is set off by space or enter, and timeouts after 3 seconds.
      Shows your external, lan, and gateway ip's, can refresh with right mouse click, and opens the default browser if the correspondent button is pressed.
      Able to change system volume by a set percentage, reading from the inputbox the number the user sets, if 0 or empty uses system default.
      I made this because the existing string trigger applications didn't do it for me for a number of reasons.
      I did this for me, but if someone finds it useful all the better.
    • By Jeep
      Here is an other UDF for string handling :
      Date handling
      _StringDateConvert:  convert a date from one format ("YMD", "MDY" or "DMY") to another.
      _StringIsDate:  checks if a date with a given format is valid
      String management
      _StringCount: count of occurrences that appear in a string
      _StringFormatBytesSize: formatting a dimension expressed in bytes (bytes) in MB, TB, ...)
      _StringIsEndingWith: check if a string end with some characters
      _StringIsStartingWith: check if a string start with some characters
      _StringJoinArray:  concatenate elements of an array to rebuild a string
      _StringPadLeft: filling a string with characters on the left
      _StringPadRight: fill a string with characters on the right
      _StringRemoveFrenchAccent: remove french accent
      _StringRemoveChars: deleting characters from a string
      _StringStrip: eliminate characters at the begin and/or at the  end of a string
      _StringTitleCaseFrench: capitalize the first letter of each word with elimination of french accents
      _StringWSClean: simple replacement of "White Spaces",  remove beginning and trailing spaces and multiple spaces removal
      Any comments, suggestions for improvement or constructive criticism are welcome.
      Below you will find the UDF and a demo program. 
       
       
      JPD_String.zip
×
×
  • Create New...