WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-08-2010, 08:40 PM
jassel41 jassel41 is offline
Member
 
Join Date: Nov 2009
Posts: 24
Converting a character to a number

I am currently trying to figure out how to retrieve a character from a text file and turn it to a number.

I currently split up the sentence and store the word I am interested in into an array, for example a spot in the array may look like the following:

['Interval=4;']

What I want to do is access the 4 and save its numeric value to a variable. If this is stored in array[1] for example, is there a way to access the 10th character, (the 4) and then convert it to a number?

Thank you,
Jassel41
Reply With Quote
  #2  
Old 02-10-2010, 07:37 AM
JvdBosch JvdBosch is offline
Member
 
Join Date: Sep 2006
Posts: 36
string = 'Interval=4'

string.split('=')[1] will return 4 (as string)
int(string.split('=')[1]) will return 4 (as int)
string[9] will return 4 (as string)
int(string[9]) will return 4 (as int)

And so on. Good luck!
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Special character adimov Vizard 1 06-15-2009 12:32 PM
character pack and walkto ? digitaldarklord Vizard 1 09-30-2008 04:42 PM
Native WorldViz support for character animation luakt Vizard 10 09-15-2008 11:39 PM
Locking every bone of a character Frank Verberne Vizard 2 03-17-2008 10:21 AM
limits on number of objects benelux Vizard 3 07-22-2004 01:26 PM


All times are GMT -7. The time now is 12:27 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC