issue of String.Split("")

Hi you

I have a string that contains a name entry, and I care about them overturned in 2 parts and the record within a table, the first name and last name.

How do with string.split?

My current code is

myNameArray = str_adminInput.split("");

This code only works if the names are: Jack Lee, June Poh.

This code does not work if the names are: Lee Tok Kong, Tan Beng Seng.

How to solve this problem?

-Zainuu

I think you can do this:

var firstname:String = str_adminInput.substring (0, str_adminInput.indexOf(""));

var secondname:String = str_adminInput.substring (str_adminInput.indexOf(""), str_adminInput.length);

myNameArray = new Array (firstname, secondname);

Tags: Adobe Animate

Similar Questions

  • ORA-01436: CONNECT loop in the user data when the delimited string splitting by the

    I'm trying to split a string into records. The values are three characters more '-' with a limit of 12 values. The values themselves are a combination of two data, the first being two characters, a.

    The following example translates: ORA-01436: CONNECT BY a loop in the user data

    WITH
        Data(Code, Datum)
    AS
        (
         SELECT 'VGCU3VM', '00V-YYG-BVC-PIU-DV3-EVV-TVM-' FROM Dual UNION ALL
         SELECT 'VGAU3VM', '00V-YYG-BVA-PIU-DV3-EVV-TVM-' FROM Dual UNION ALL
         SELECT 'VGLN3CM', '00V-YYG-BVL-PIN-DV3-EVC-TVM-' FROM Dual UNION ALL
         SELECT 'VGLT3PM', '00V-YYG-BVL-PIT-DV3-EVP-TVM-' FROM Dual UNION ALL
         SELECT 'VGAT3RA', '00V-YYG-BVA-PIT-DV3-EVR-TVA-' FROM Dual
        )
    SELECT
        Datum,
        LEVEL,
        SUBSTR(Datum, ((LEVEL - 1) * 4) + 1, 2),
        SUBSTR(Datum, ((LEVEL - 1) * 4) + 3, 1)
    FROM
        Data
    CONNECT BY
        Code    = PRIOR Code
        AND    LEVEL    <= LENGTH(Datum) / 4;
    
    

    Remove the 'Code = Code PREREQUISITE"clause, to avoid the error, but too many records are returned, because nothing is to limit the records in their own groups.

    The following works:

    WITH
        Data(Code, Datum)
    AS
        (
         SELECT 'VGCU3VM', '00V-YYG-BVC-PIU-DV3-EVV-TVM-' FROM Dual UNION ALL
         SELECT 'VGAU3VM', '00V-YYG-BVA-PIU-DV3-EVV-TVM-' FROM Dual UNION ALL
         SELECT 'VGLN3CM', '00V-YYG-BVL-PIN-DV3-EVC-TVM-' FROM Dual UNION ALL
         SELECT 'VGLT3PM', '00V-YYG-BVL-PIT-DV3-EVP-TVM-' FROM Dual UNION ALL
         SELECT 'VGAT3RA', '00V-YYG-BVA-PIT-DV3-EVR-TVA-' FROM Dual
        )
    SELECT
        Datum,
        SUBSTR(Datum, ((Some.Num - 1) * 4) + 1, 2) A,
        SUBSTR(Datum, ((Some.Num - 1) * 4) + 3, 1) B
    FROM
        Data,
        (SELECT LEVEL Num FROM Dual CONNECT BY LEVEL <= 12) Some
    WHERE
        SUBSTR(Datum, ((Some.Num - 1) * 4) + 1, 2) IS NOT NULL;
    
    

    What causes ORA-01436?

    Hello

    Depending on your version, you can add another condition to your CONNECT BY clause.

    It works in Oracle 11.2.0.3.0:

    SELECT

    Point of reference,

    LEVEL,

    SUBSTR (Datum, ((LEVEL-1) * 4) + 1, 2),

    SUBSTR (Datum, ((LEVEL-1) * 4) + 3, 1)

    Of

    Data

    CONNECT

    Code = Code PRIOR

    AND LEVEL<= length(datum)="">

    AND PRIOR SYS_GUID () IS NOT NULL-* ADDED *.

    ;

    Thanks for the display of the data of the sample; This is really useful!

    In addition, relational databases are designed to have 1 piece of information in each column of each row, not a list delimited by up to 12 points.  It is so basic to the design of database he called the first normal form.  You're going to solve a lot of problems even before they occur if you paste to first normal form and change the table structure to resemble the result set of this query.  (Maybe that's exactly why you're doing this query.)

  • string Split in 2 words

    Hello

    If I have the string "test1 test2-ttt test3 '... How to split the string into two strings, so the 1st string contains the 1st Word and the second the words after the first space?
    for example, in my case str1 = str2 = ttt-test2 test3 and test1

    I tried with
    select substr('test1 test2-ttt test3', 1, instr('test1 test2-ttt test3', ' ', instr(''test1 test2-ttt test3', ' ')+1)-1)
    from dual;
    but this isn't the desired result...

    Thanks in advance!

    Try
    substr ("test1 test2-ttt test3", 1, instr('test1 test2-ttt test3',' ')-1) select word1, substr ('test1 test2-ttt test3', instr ("test1 test2-ttt test3 ',' '") + 1) double word2.

    Alexander gelin
    http://nimishgarg.blogspot.com/

  • Help with string.split() for line breaks and spaces

    What I'm trying to do is to take a series of numbers and convert it to a table, while cutting the numbers, aren't. Here's the format:

    1.0000000E + 000 + 000 1.3668423e

    1.0000000E + 000 + 000 1.3668423e

    1.0000000E + 000 + 000 1.3668423e

    ...

    So it is basically: space, space, digits, space, space, numbers, line break

    Right now I am using the following code (myString is a string, and dataSet1 is an array):

    var reg: RegExp = new RegExp ("\n");

    myString = textLoader.data;
    myString.split (reg) = dataSet1;

    I tried ("\n\s") and ("(\n)(\s*)") and many other combinations, but I can't seem to figure out how to make multiple conditions in a regular expression. All I need to do is to remove all the spaces and line breaks and I should be good.

    I appreciate any help, thanks.

    You can use the Array.map method to convert your strings. Something like this:

    function str2Num(element:*,_index:int,_arr:Array):Number
    {
    Return Number (item);
    }

    var arr:Array;

    ARR = myString.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s + /);

    ARR = map (str2Num, null);

    or combine them all in a single statement

    ARR = myString.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s + /) .map (str2Num, null);

  • string split or group

    I want to divide and put the string in table... for example I want to group 4 which is array1 and array2, array3, array4

    and then if I write 1111 0010 he enters my array array1 and 0010 will be my value below

    so if I write 2222 0011 he enters my array array2 and 0011 will be my value underneath and so forth for array3 and array4

    simplify I write 1111 0010 3333 2222 0011 0012 4444 0013 that my table will look like this

    table 1 table 2 array3 array4

    0010 0011 0012 0013

    If other than the 1111,2222,3333 and I want to ignore it and it's the value of 4444

    can someone give me some example about it


  • Issue replacement string &amp; title of chart axis with. syntax

    Apex 4.1.1

    Hello

    I'm having a problem of replacement of a title of axis of graph with the substitution syntax &. P5_MYFIELD, where P5_MYFIELD is an element whose body of PL/SQL by Type of Source function:
    Start
    Return web_message.show ("LASTNAME", "dk");
    end;

    The element is set to the same Page as the graphic in a different region. I see that feature works well, because the return value is displayed in P5_MYFIELD.
    There is a second point in another region on the same page where the source value is set with the substitution syntax & P5_MYFIELD. It also displays the expected value. But when I use the string & P5_MYFIELD. as the title of the axis, it is not displayed.

    I also defined a P0_MYFIELD field on the zero of the Page with the same function, when I reference that with & P0_MYFIELD. as the title of the axis at Page 5, the value appears correctly. I tried the same thing with a field on the Page 1, & P1_MYFIELD. and it appears correctly.

    In my view, the chart axis title must be replaced before that the P5_MYFIELD element is the execution of the body of the PL/SQL function to get its value. Can someone tell me why?

    We want to use the syntax of string substitution to translate all our labels in different languages. I would like to create hidden objects with type body of the PL/SQL function for all the labels on a page of the source and refer to these values as the label definitions. I would like to place them on the same page as the labels.

    Thank you
    Anne

    The fundamental thing is that the P5_MYFIELD must be filled before the real graphics area where you want to reference.

    Because in the APEX, is made in a particular order according to their point of view, sequences etc...

    So the best way would be to move the element source (body of the PL/SQL function) to a calculation with calculation point before the header

    Now when you return your apex page, the value of the items will be available for all regions, which restitueront after the header

  • String Split and join

    Hi all.

    I have a form with a TextBox for the display name and I want the fist letter capitalized in the first and last name.

    I have a function for it and everything works fine, the problem comes when there is a hyphen "-" in the name. I work part of split, but I can't make it work on the side of the join.

    function ucFirstAllWords( str )
    {
              var pieces = str.split(" "); //use this for space and "-" split (/[ \/-]/);
        for ( var i = 0; i < pieces.length; i++ )
        {
            var j = pieces[i].charAt(0).toUpperCase();
            pieces[i] = j + pieces[i].substr(1);
        }
        return pieces.join(" ");
    }
    
    

    If I use this code and slpit on the hyphen and space all get the join with the space, I tyed to do a function in function to capture the first hyphen, but that did not work probably hurting

    Does anyone have an idea how to fix?

    I am on LK 8.0

    Thank you.

    Fredrik Nordstrand, Sweden

    Hi Scott.

    I want to 'john doe' to be "John Doe" and 'Rose of ann-lee' to be 'Ann - Lee Rose Bush.

    Make any sense?

    Woks fine scrip but not with a name that contains a hyphen.

    If I use the split to include the hyphen "ann-lee" would become "Ann Lee" and that's not true.

  • String.Split on temporal Bay of the URL button

    Hi people.

    It is therefore part of the current video player that I am. Here is the configuration of the problem:

    customer must have taken URL applied to an invisible button when commercials (usually 30 seconds each). There are some javascript controls that populate the click URL, which are separated by ",". The tracking URL could be between one and 3 URLS per 30 second commercial. If it is 3, then the URL changes every 10 seconds.

    Right now I have the button work - any. Javascript fills the invisible button, but when you click on the button during the commercial you get the pop-up windows three rather than one by trading block (i.e. y three popups different with three different URL - but at the same time, just by click).

    Code is below / attached.

    However, when I add in this code, it just seems looped and stops the action of the button. For most the 'if' statement is the problem.

    So no idea on how I can get the URL to fill one at a time by time frame?

    If you want to hire me to solve your problem, send me an email via my website.

  • Split string

    Dear Sir

    Is there a simple function like string.split

    I want to just split this string 384; 603; 107; 38

    Rgds

    Nadir

    and this thread can also help you:

    http://supportforums.BlackBerry.com/T5/Java-development/how-to-split-a-string-in-to-a-string-array-w...

  • String is split for model [|]

    Hello I want to split the string with "[|]" so what is the model for string split for this

    Concerning
    Mayur Mitkari

    Mayur Mitkari wrote:
    his does not work

    Yes.

  • How to convert String to Date

    hell there everyone,

    I have a question which is:

    How to convert a string that we get by reading an XML in the instance of date value type?

    So there is a XML that modifiedDate as an attribute on a node of the XML and how I put this value in an instance variable date?

    the timeformat in the XML file is: mm/dd/yyyy hh: mm: = > 31/12/2010 23:57:46

    I chose this time format because I want to use the method . parse() which always causes an error, but that's another topic...,.

    hope I was clear on the issue,

    Thanks in advance for the help.

    First of all, you should watch the Date object constructor to find out how to specify different parameters.

    public void Date (yearOrTimevalue:Object, month:number, date:number = 1, hour:number = 0, minute:number = 0, second:number = 0, millisecond:number = 0)

    Then you need to determne how to break the string by using the String.Split method.  The first split() should be the space between the date and time, the second for the slashes in the date and the third for the colon in time.

    Then you come to take each of these paintings of substrings and feed them in the constructor as the Number() values.

    If you remain unsure how to do this, look at the different terms that I have identified in the help documents and you will find them all explained with examples.

  • Issues of Flash, PHP, mySQL

    Hey guys.

    You will see my below php file. Here's what's happening. My PHP file is a file and path name generator. Its purpose is to simply generate a list of all jpg files in a given directory and return the list back Flash. It works perfectly straight from the file php itself.

    I really want to know the most effective (IYHO) to extract the data from the table into flash from a PHP file. $print_r in php actually does not return an array, but rather a string based on the table. How I pull data in Flash as a table so that I can target the data in this table (or better yet, use it in the appeal of an object, as it will be in the final version).

    For LoadVars, we moved on this issue to pass a string delimited such as comma delimited and use String.split to it burst.

    You could also spend the XML. and use the Flash XML class to get the data.

  • BUG: Split then join reverse byte order - sometimes

    I created a simple to serialize an array of bytes I32 and fell VI on this interesting bug. This code runs in 32-bit SP1 of LabVIEW in 2014, fully patched. Save the parts two attached and run TestI32ToByteArray.vi. Note that the 6 and 7 at the end of the table are reversed. If you explore the data around, everything looks good except the string split on the last low word is reversed. Any ideas?

    More details on the installation program:

    LabVIEW 2014 SP1 32-bit

    AMD FX - 6300 3.5 GHz processor hexagonal

    Windows 7 64 - bit, fully patched

    8 GB RAM

    Check your wiring, 6 is connected to a lower bound of the join, and 7 is wired to the top.

  • Features of LabView string StartsWith as in c#?

    Hi all

    in c# (.NET) there is a good class: String

    There, it is possible for example to get information, if the string startswith one substring special.

    Is that what this possibility in LabView? Y at - it these LabView vi, which offers this feature? (Excerpts)?

    So I ask you:

    I want to create a switch/case (structure-case) block in labview for this code:

    If (String.StartsWith ("XYZ")) step in case1

    another step if (string.startswith ("DEF")) in CAS2

    ...

    BTW:

    It would be great if someone could create polymorphic VI with these functions:

    (from c# string class)

    public object Clone();
    public static int Compare (string strA, string strB);
    public static int Compare (string strA, string strB, Boolean ignoreCase);
    public static int Compare (string strA, strB string, StringComparison comparisonType.greater);
    public static int Compare (string strA, string strB, Boolean ignoreCase, CultureInfo culture);
    public static int Compare (string strA, string strB, CultureInfo culture, CompareOptions options);
    public static int Compare (string strA, int indexed, string strB, indexB int, int length);
    public static int Compare (string strA, int indexed, string strB, indexB int, int length, Boolean ignoreCase);
    public static int Compare (string strA, int indexed, string strB, indexB int, int length, StringComparison comparisonType.greater);
    public static int Compare (string strA, int indexed, string strB, indexB int, int length, Boolean ignoreCase, CultureInfo culture);
    public static int Compare (string strA, int indexed, string strB, indexB int, int length, CultureInfo culture, CompareOptions options);
    public static int CompareOrdinal (string strA, string strB);
    public static int CompareOrdinal (string strA, int indexed, string strB, indexB int, int length);
    public int CompareTo (object value);
    public int CompareTo (string strB);
    Public Shared Function Concat (IEnumerable values );
    public static string Concat(IEnumerable values);
    Public Shared Function Concat (object arg0);
    public static string Concat (params object [] args);
    Public Shared Function Concat (params string [] values);
    Public Shared Function Concat (object arg0, object arg1);
    Public Shared Function Concat (string str0, string str1);
    public static string Concat (object arg0, object arg1, object arg2);
    Public Shared Function Concat (string str0, string str1, string str2);
    public static string Concat (object arg0, object arg1, arg2, object arg3);
    public static string Concat (string str0, string str1, str2, string, string str3);
    public boolean Contains (string value);
    Public Shared Function Copy (string str);
    public final void CopyTo (int sourceIndex, destination of char [], int destinationIndex, int count);
    public boolean EndsWith (string value);
    public boolean EndsWith (value string, StringComparison comparisonType.greater);
    public boolean EndsWith (string value, Boolean ignoreCase, CultureInfo culture);
    public boolean Equals (object obj);
    public boolean Equals (string value);
    public static Boolean Equals (String, b string);
    public boolean Equals (string, StringComparison comparisonType.greater value);
    public static Boolean Equals (string a, b string, StringComparison comparisonType.greater);
    Public Shared Function Format (string format, object arg0);
    Public Shared Function Format (string format, params object [] args);
    Public Shared Function Format (IFormatProvider provider, format of the string, params object [] args);
    Public Shared Function Format (string format, object arg0, object arg1);
    Public Shared Function Format (string format, object arg0, object arg1, object arg2);
    public CharEnumerator GetEnumerator;
    public override int GetHashCode();
    public TypeCode GetTypeCode();
    public int IndexOf (char value);
    public int IndexOf (string value);
    public int IndexOf (char value, int startIndex);
    public int IndexOf (string value, int startIndex);
    public int IndexOf (string value, StringComparison comparisonType.greater);
    public int IndexOf (value char, int startIndex, int count);
    public int IndexOf (string value, int startIndex, int count);
    public int IndexOf (string value, int startIndex, StringComparison comparisonType.greater);
    public int IndexOf (string value, int startIndex, int count, StringComparison comparisonType.greater);
    public int IndexOfAny (char [] anyOf);
    public int IndexOfAny (char [], int startIndex anyOf);

    public int IndexOfAny (anyOf char [], int startIndex, int count);
    public string Insert (int startIndex, string value);
    Public Shared Function Intern (string str);
    public static IsInterned (string str);
    public boolean IsNormalized();
    public bool IsNormalized (NormalizationForm normalizationForm);
    public static Boolean IsNullOrEmpty (string value);
    public static Boolean IsNullOrWhiteSpace (string value);
    Public Shared Function Join (separator string, IEnumerable values);
    Public Shared Function Join(separator string, IEnumerable values);
    Public Shared Function Join (separator string, params object [] values);
    Public Shared Function Join (separator string, params string [] value);
    Public Shared Function Join (separator string, string [], int startIndex, int count);
    public int LastIndexOf (char value);
    public int LastIndexOf (string value);
    public int LastIndexOf (char, int startIndex value);
    public int LastIndexOf (string value, int startIndex);
    public int LastIndexOf (string value, StringComparison comparisonType.greater);
    public int LastIndexOf (value char, int startIndex, int count);
    public int LastIndexOf (string value, int startIndex, int count);
    public int LastIndexOf (string value, int startIndex, StringComparison comparisonType.greater);
    public int LastIndexOf (string value, int startIndex, int count, StringComparison comparisonType.greater);
    public int LastIndexOfAny (char [] anyOf);
    public int LastIndexOfAny (char [], int startIndex anyOf);
    public int LastIndexOfAny (anyOf char [], int startIndex, int count);
    public string Normalize();
    public string Normalize (NormalizationForm normalizationForm);
    public string PadLeft (int totalWidth);
    public string PadLeft (totalWidth int, char paddingChar);
    public string PadRight (int totalWidth);
    public string PadRight (totalWidth int, char paddingChar);
    public string Remove (int startIndex);
    public string Remove (int startIndex, int count);
    public string Replace (char oldChar, char newChar);
    public string Replace (string oldValue, string newValue);
    public string [] Split (params char [] separator);
    public string [] Split (separator char [], int count);
    public string [] Split (char [], StringSplitOptions options separator);
    public string [] Split (String [], StringSplitOptions options separator);
    public string [] Split (char [], int count, StringSplitOptions options separator);
    public string [] Split (String [], int count, StringSplitOptions options separator);
    public boolean StartsWith (string value);
    public boolean StartsWith (value string, StringComparison comparisonType.greater);
    public boolean StartsWith (string value, Boolean ignoreCase, CultureInfo culture);
    public string Substring (int startIndex);
    public string Substring (int startIndex, int length);
    public char [] ToCharArray();
    public char [] ToCharArray (int startIndex, int length);
    public string ToLower();
    public string ToLower (CultureInfo culture);
    public string ToUpperInvariant();
    Public Overrides Function ToString();
    public string ToString (IFormatProvider provider);
    public string ToUpper();
    public string ToUpper (CultureInfo culture);
    public string ToUpperInvariant();
    public string Trim();
    public string Trim (params char [] trimChars);
    public string TrimEnd (params char [] trimChars);
    public string TrimStart (params char [] trimChars);

    So I ask you:

    I want to create a switch/case (structure-case) block in labview for this code:

    This can be done already with the structure of the case, you can make simple analysis in the case selector, which takes a string as input.

    Type in the case of the first case "XYZ".... "XYZ".

    Enter the next case "DEF".... "DEF ~".

    Next is the empty string, the default value.

    How does this work:

    The "XYZ...". "XYZ ~ ' matches all strings that begin with XYZ and any ascii value after the ~ is the highest value printable 7-bit ascii for that catches all the other characters.

    Option 2 is parse (there is expression reg very good vi in the channel palette) the string and create if a corresponding to the value of the integer can habdle unique integers in the structure of the case.

    There are so many ways to do it without a wrapper for the string .net class, I have provided some quick methods

  • Specific string matching (Hex 2E2E)

    I have a file that I have to deal with, a beautiful simple function to create.

    Read file, find the part of the file with the string of some data in it, create the output of data in expanded format table and save the spreadsheet file (for example csv will do)

    This is the problem, the data is in the format:

    PS1 #PS0 #, #PS3 #c3... 31, c34 #... 126

    (I can remove the # and no probs.) The bit that kills me, is that I need to extend the range of c3 to c31. We'll never find a match pattern '.. 'because'. ' is a special character in match pattern and matching of regular expressions - thank you NOR.)

    I can kind to locate using the string split function, but it does not I want very efficient, if someone at - there ideas for a better way around this problem?

    See you soon

    James

    Hi James,

    Try this:

Maybe you are looking for

  • Apple Watch wrist pain

    I bought my Apple Watch mid July 2016 and thereafter wear a few weeks noticed that my wrist was really painful. Now, I have so I assigned to whom, but have not had my wrist hurt like this over the years. I went to my other wrist and had the same prob

  • What happened to the HP - 11 c? I do not understand, they apparently still on HP-12.

    Why would they do this decision? It sounds funny.  I love my HP - 11 c.  What can I do if he dies?  EBay search used calculator? Richard

  • Quick deletion of multiple files?

    I have an iMac and spin El Capitan.  My hard drive is not defragind or strippers. I'm trying to clean up my iCloud Phot files.  I have tens of thousands of files I want to delete.  For some, it has been more than a year stuck with the files that I do

  • Laptop HP 15-r006TX - drivers problem

    Hi Sir, I bought a new laptop (HP PC laptop 15-r006TX). I need a suggestion for the operating system for laptop. I have used windows7 ultimate. But most of the drivers is not supported in it. http://h10025.www1.HP.com/ewfrf/wc/softwareCategory?OS=406

  • Partition will not erase!

    So, I just got a 3 TB hard drive, and I'm ready to install and set up and everything. I couldn't use my E: drive, like I wanted, so I agree as well. Start down, go to unplug my disk drives, and I noticed something interesting. There is a hard drive t