Jump to content

Recommended Posts

Posted

Hi I would like to replace the tab and unknown white space characters with space. Using StringReplace

$var=Kvcbao Hcfgfer 555-555-1498    N5kaujgnhg6hhli35@gmail.com

I know how to use stringreplace but I can't figure out how to replace the tab with space and I don't know what type of space is used between the number and the email.

 

Posted

Really what i want to do is just break the variable up into an array of 4. With stringsplit but once again I can't identify the delimiter. When I copy and paste the delimiter I want from note pad it's just appears as a space " " in the autoit script. Tab as well apears as space.

Posted
#include <StringConstants.au3>

Local $var = "Kvcbao Hcfgfer 555-555-1498         N5kaujgnhg6hhli35@gmail.com"

Local $var_new = StringStripWS($var, $STR_STRIPSPACES)

MsgBox(0, "", $var_new)

 

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Posted

You might directly parse your string to get an array of non-whitespace chars sequences  :)

#include <StringConstants.au3>
#Include <Array.au3>

$var = "Kvcbao Hcfgfer 555-555-1498         N5kaujgnhg6hhli35@gmail.com"

$res = StringRegExp($var, '\S+', $STR_REGEXPARRAYGLOBALMATCH)
 _ArrayDisplay($res)

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...