由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Computation版 - 问个Fortran字符串操作的问题
相关主题
再问个random number的问题<>全书下载
再问个Fortran得问题哪里有Fortran教程可下?
问个矩阵生成Fortran里面哪个函数显示系统时间?
问个编译器的问题where to down a standard Fortran90 complier?
问个fortran和python编程的问题一工程计算站点
问个很2的问题,我装的Parallel Studio XE 2011怎么找不到? (Write In C
a question about 1-D PDE (转载)Include unix libraries in windows fortran
Re: anyone know how to compile a libary coded in c which any be used bhelp fortran read format
相关话题的讨论汇总
话题: fortran话题: function话题: str话题: length话题: tell
进入Computation版参与讨论
1 (共1页)
r****y
发帖数: 1437
1
Is there a function in fortran which can tell the length of a string?
For example
character*80 A
A='dfwrerefdfe'

which function can tell the length of this A?
Have not used Fortran for a long long time, so rusty now. :-((
h***o
发帖数: 539
2
integer function strlen(str)
integer i
character str*(*)
i = len(str)
do while (str(i:i) .eq. ' ')
i = i - 1
enddo
strlen = i
return
end
fortran is really awkward...

【在 r****y 的大作中提到】
: Is there a function in fortran which can tell the length of a string?
: For example
: character*80 A
: A='dfwrerefdfe'
:
: which function can tell the length of this A?
: Have not used Fortran for a long long time, so rusty now. :-((

a*******x
发帖数: 47
3
use the function "len" and "len_trim".

【在 r****y 的大作中提到】
: Is there a function in fortran which can tell the length of a string?
: For example
: character*80 A
: A='dfwrerefdfe'
:
: which function can tell the length of this A?
: Have not used Fortran for a long long time, so rusty now. :-((

a*******x
发帖数: 47
4
Peng

【在 h***o 的大作中提到】
: integer function strlen(str)
: integer i
: character str*(*)
: i = len(str)
: do while (str(i:i) .eq. ' ')
: i = i - 1
: enddo
: strlen = i
: return
: end

r****y
发帖数: 1437
5
Thanks. Where are you now, graduated yet? :-)

【在 h***o 的大作中提到】
: integer function strlen(str)
: integer i
: character str*(*)
: i = len(str)
: do while (str(i:i) .eq. ' ')
: i = i - 1
: enddo
: strlen = i
: return
: end

h***o
发帖数: 539
6
looking for job now....

【在 r****y 的大作中提到】
: Thanks. Where are you now, graduated yet? :-)
1 (共1页)
进入Computation版参与讨论
相关主题
help fortran read format问个fortran和python编程的问题
Re: help fortran read format, why not try excel?问个很2的问题,我装的Parallel Studio XE 2011怎么找不到? (
Fortran和C++的数据转换问题a question about 1-D PDE (转载)
[转载] How to check the stack-size?Re: anyone know how to compile a libary coded in c which any be used b
再问个random number的问题<>全书下载
再问个Fortran得问题哪里有Fortran教程可下?
问个矩阵生成Fortran里面哪个函数显示系统时间?
问个编译器的问题where to down a standard Fortran90 complier?
相关话题的讨论汇总
话题: fortran话题: function话题: str话题: length话题: tell