How to Break up a string 
Author Message
 How to Break up a string

What i am doing is that when one user types in his first name and last
name, and than script pick up the first character of the first name and
concatenate with last name.

Could you tell me how to break up the first name with the{*filter*}character
and the last of the string?

thanks..........
?



Fri, 28 Dec 2001 03:00:00 GMT  
 How to Break up a string
Are you talking about taking the first letter of the first name, last name  and a comma
like  changing your name to Yoon, K, if so;

daName = frmOne.txtOne.value
temp = split(daName, " ")
newName = temp(1) & ", " & left(temp(0),1)

See
http://www.*-*-*.com/
and
http://www.*-*-*.com/

I hope that is what you meant and good luck.
--
Regards,
Tony
Developer/designer/all around good guy
www.csofm.com
We specialize in Medical and Construction office/web solutions

Come see the last best place, Billings, MT
www.csofm.com/blgsdine/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Quote:

> What i am doing is that when one user types in his first name and last
> name, and than script pick up the first character of the first name and
> concatenate with last name.

> Could you tell me how to break up the first name with the{*filter*}character
> and the last of the string?

> thanks..........



Fri, 28 Dec 2001 03:00:00 GMT  
 How to Break up a string
You can write a simple function such as;

Function MakeName(byref inputstring) as string
'What this does is look for the space that separates the first and
last name and uses it to split them into two separate variables.
dim firstinitial
dim lastname

        firstinitial = left(inputstring, 1) 'Get the first character
of the string. You could add an error trapping section in case the
user enters a space or an invalid character at the beginning. Users do
this from time to time.

        lastname = right(inputstring, len(inputstring)-
instr(inputstring, " "))'This gets the lastname after the space in the
input string. I think I did it right (I haven't tested it).

MakeName = firstinitial & lastname 'This sets the return string to
what you want.
end function

Thus to use the function you would call it as such,

dim FullName
dim NewName
FullName = "Philip Lemon"
NewName = MakeName(FullName)

That's it. I hope it helps.

Phil



Quote:
>What i am doing is that when one user types in his first name and last
>name, and than script pick up the first character of the first name and
>concatenate with last name.

>Could you tell me how to break up the first name with the{*filter*}character
>and the last of the string?

>thanks..........
>?



Sat, 29 Dec 2001 03:00:00 GMT  
 How to Break up a string
Dear Kiwook ,

After taking that value into a variable ,  Try to use delimiter command
with  parameter  ""

Bye
Sanjeev Chand

Quote:

> What i am doing is that when one user types in his first name and last
> name, and than script pick up the first character of the first name and
> concatenate with last name.

> Could you tell me how to break up the first name with the{*filter*}character
> and the last of the string?

> thanks..........



Sat, 29 Dec 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Break single string with carriage return into 2 strings

2. Break Apart String Using Index

3. breaking apart a string

4. Break Apart String Using Index

5. Single quote in string from data bound control breaks window.open script

6. Breaking string into fields?

7. Breaking String for Outlook

8. Replace Break lines with spaces in a string

9. Break Apart String Using Index

10. How to break up a string and numbers?

11. Break apart (split) a string in Visual Basic/Access 97

12. Line breaks in strings

 

 
Powered by phpBB® Forum Software