+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, extract first letter from a string -vbs in Coding and Web Development; I'm sure it's a no-brainer for most of you. I have this line. and instead of getting firstname.sirname I need ...
  1. #1


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339

    extract first letter from a string -vbs

    I'm sure it's a no-brainer for most of you.
    I have this line. and instead of getting firstname.sirname I need firstinitial.sirname.

    Code:
    objUser.put "physicalDeliveryOfficeName", objUser.Get("givenName") & "." & objUser.Get("sn")
    ie - extract the first letter from "givenName"


    Thanks

  2. #2

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,751
    Thank Post
    3,264
    Thanked 1,051 Times in 972 Posts
    Rep Power
    364
    Quote Originally Posted by CyberNerd View Post
    I'm sure it's a no-brainer for most of you.
    I have this line. and instead of getting firstname.sirname I need firstinitial.sirname.

    Code:
    objUser.put "physicalDeliveryOfficeName", objUser.Get("givenName") & "." & objUser.Get("sn")
    Thanks
    Code:
    objUser.put "physicalDeliveryOfficeName", Left(objUser.Get("givenName"),1) & "." & objUser.Get("sn")
    http://www.devguru.com/technologies/...kRef/left.html

  3. Thanks to mac_shinobi from:

    CyberNerd (10th December 2009)

  4. #3


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    thats the ticket

  5. #4

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,751
    Thank Post
    3,264
    Thanked 1,051 Times in 972 Posts
    Rep Power
    364
    no worries fella - just string manipulation functions ie left, right, midstr, strrev, instrrev, etc not sure if vbscript supports all of them but a quick google should fix that

SHARE:
+ Post New Thread

Similar Threads

  1. How to work out domain string (LDAP I think)
    By garethedmondson in forum Windows
    Replies: 16
    Last Post: 9th September 2009, 11:15 PM
  2. Powershell modify multi-string values in AD
    By maf_001 in forum Scripts
    Replies: 1
    Last Post: 28th August 2009, 01:12 PM
  3. Mysql - pre-pend to string
    By danIT in forum Coding
    Replies: 3
    Last Post: 9th January 2009, 06:17 PM
  4. need to extract text from a string in excel
    By projector1 in forum How do you do....it?
    Replies: 7
    Last Post: 14th February 2007, 01:41 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •