473,385 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Interrogating string for number of characters, response.writing identical number of characters on new line

Suppose I have strString. I want to determine the length of strString in #
of characters, and write that number of characters on a subsequent line as a
dummy character, say a hypen.

In other words, I want to be able to dynamically create the following
presentation in ASCII:

Title title title title title title
-------------------------

Note that the number of hyphens equals the number of characters in "Title
title title title ...", which would be stuffed in strString.

Any help out there?

BTW, thanks to all the smarties in the group who have helped me out over the
past few years. The community has helped make my career.

-KF
Jul 19 '05 #1
2 1525
theString = "Title title title title title title"
theChar = "-"
Response.Write String(Len(theString), theChar)

--

Ray at home
Microsoft ASP MVP
"Ken Fine" <ke*****@u.washington.edu> wrote in message
news:bv**********@nntp6.u.washington.edu...
Suppose I have strString. I want to determine the length of strString in #
of characters, and write that number of characters on a subsequent line as a dummy character, say a hypen.

In other words, I want to be able to dynamically create the following
presentation in ASCII:

Title title title title title title
-------------------------

Note that the number of hyphens equals the number of characters in "Title
title title title ...", which would be stuffed in strString.

Any help out there?

BTW, thanks to all the smarties in the group who have helped me out over the past few years. The community has helped make my career.

-KF

Jul 19 '05 #2
Works like a charm, so simple, so sweet...Thanks again, Ray at home.

-KF

"Ray at <%=sLocation%> [MVP]" <myFirstNameATlane34dotKOMM> wrote in message
news:OC**************@TK2MSFTNGP12.phx.gbl...
theString = "Title title title title title title"
theChar = "-"
Response.Write String(Len(theString), theChar)

--

Ray at home
Microsoft ASP MVP
"Ken Fine" <ke*****@u.washington.edu> wrote in message
news:bv**********@nntp6.u.washington.edu...
Suppose I have strString. I want to determine the length of strString in # of characters, and write that number of characters on a subsequent line as
a
dummy character, say a hypen.

In other words, I want to be able to dynamically create the following
presentation in ASCII:

Title title title title title title
-------------------------

Note that the number of hyphens equals the number of characters in

"Title title title title ...", which would be stuffed in strString.

Any help out there?

BTW, thanks to all the smarties in the group who have helped me out over

the
past few years. The community has helped make my career.

-KF


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
by: Alan | last post by:
hi all, I want to define a constant length string, say 4 then in a function at some time, I want to set the string to a constant value, say a below is my code but it fails what is the correct...
3
by: happy | last post by:
How will I read a string using scanf in that function : to the write what scanedf will be written using fprintf customer_input(cust) /*---------------------*/ struct customer_record *cust; {...
17
by: Chad Myers | last post by:
I've been perf testing an application of mine and I've noticed that there are a lot (and I mean A LOT -- megabytes and megabytes of 'em) System.String instances being created. I've done some...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
8
by: ais523 | last post by:
I use this function that I wrote for inputting strings. It's meant to return a pointer to mallocated memory holding one input string, or 0 on error. (Personally, I prefer to use 0 to NULL when...
11
by: billpaterson2006 | last post by:
I've been working on some code to search for specific textstrings and act upon them insome way. I've got the conversion sorted however there is 1 problem remaining. I am trying to work out how...
14
by: Steve Bergman | last post by:
I'm looking for a module to do fuzzy comparison of strings. I have 2 item master files which are supposed to be identical, but they have thousands of records where the item numbers don't match in...
1
by: kellysgirl | last post by:
Now what you are going to see posted here is both the set of instructions I was given..and the code I have written. The instructions I was given are as follows In this case, you will create...
28
by: v4vijayakumar | last post by:
#include <string> #include <iostream> using namespace std; int main() { string str; str.resize(5); str = 't';
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.